Britney Spears and sons
Britney Spears enjoyed 'family' time with her sons following niece Maddie's recent ATV crash Britney Spears/Instagram

Popstar Britney Spears took time out to be with her nearest and dearest following the accident which almost killed her niece.

The 35-year-old enjoyed a relaxing day with her sons, Sean Preston, 11, and Jayden James, 10, from her relationship with ex, Kevin Federline.

Uploading a photo to Instagram, the Toxic hit-maker wrote alongside it: "Family time".

The trio could be seen lapping up the sun in a swimming pool complete with snacks.

It comes days after Britney's niece was discharged from hospital after an ATV crash left her in a "serious condition".

The eight-year-old was taken home by helicopter on 10 February to continue her recovery.

Her mum – Britney's younger sister Jamie Lynn Spears – revealed the happy news in a social media post.

Former Zoey 101 actress Jamie Lynn, 25, uploaded a picture of herself on Instagram stood by the New Orleans hospital's helicopter with Maddie sat in the front seat smiling.

She wrote alongside the snap: "Thanks to the amazing first responders, and medical teams at University and Children's Hospital in New Orleans, LA…

"We are headed home with our baby girl as she continues to recover.

"Above all else, we are so thankful for each and every prayer, because we know that is what truly made the difference. Thank you again to everyone. We are truly blessed."

Britney Spears' niece Maddie Aldridge left hospital
Britney Spears' niece Maddie Aldridge (pictured centre) has been discharged from hospital after ATV crash left her fighting for life Britney Spears/Instagram

Britney also thanked fans online for their prayers and well wishes.

Hailing Maddie's recovery as "a miracle," she wrote on Twitter: "So grateful that Maddie was able to go home today… It's truly a miracle.

"Our prayers were heard, and they were answered! Thank you so much for all y our love and support this week. My family appreciates it more than you will ever know."

She signed off with a purple heart emoji.

Jamie Lynn Spears and daughter Maddie Aldridge
Jamie Lynn Spears (pictured with Maddie) shared a picture leaving hospital with her daughter Jamie Lynn Spears/Instagram

According to a police report obtained by People magazine, Maddie was steering the off-road vehicle away from a drainage ditch when she crashed on 5 February.

"In doing so, she overcorrected causing the ATV to enter the pond," the publication explain the report states. "The ATV and child were instantly submerged in the water.

"Within seconds the child's mother, stepfather and other family members reached the pond, dove in and attempted to rescue the child to no avail.

"The child was trapped and secured by the seatbelt and the ATV's safety netting.

"Within two minutes, Acadian Ambulance Services arrived and assisted in freeing the child from the cold water."