Justin Timberlake has joined the celebrities rallying around Britney Spears following her dramatic day in court.

The pop superstar asked a judge to end her conservatorship during bombshell testimony in Los Angeles on Wednesday.

Spears, 39, revealed the legal arrangement that controls her life is preventing her from marrying boyfriend Sam Asghari and starting a family.

She told the court it requires her to use a birth control device to prevent her getting pregnant.

Following the hearing, Timberlake, who had a high-profile relationship with Spears in the late 1990s and early 2000s, said what is happening to his former girlfriend is “just not right”.

The actor and singer, 40, said: “After what we saw today, we should all be supporting Britney at this time. Regardless of our past, good and bad, and no matter how long ago it was… what’s happening to her is just not right. No woman should ever be restricted from making decisions about her own body.

“No one should EVER be held against their will… or ever have to ask permission to access everything they’ve worked so hard for.”

Timberlake, who split from Spears in 2002, said he and wife Jessica Biel fully support Spears. In February he apologised to Spears for how he treated her during their break-up.

Writing on Twitter following the hearing, Timberlake added: “Jess and I send our love, and our absolute support to Britney during this time. We hope the courts, and her family make this right and let her live however she wants to live.”

He joined a group of high-profile figures sharing support for Spears.

Mariah Carey tweeted: “We love you Britney!!! Stay strong.”

Pop star Halsey said she “admires” Spears’s courage for speaking out, writing online: “Bless Britney and I hope with my whole heart she is awarded freedom from this abusive system. She deserves it more than anything. I admire her courage speaking up for herself today.

“Additionally, f*** anyone who thinks they have the authority as an institution or individual to control a person’s reproductive health. #FreeBritney.”

Reality TV star Khloe Kardashian said: “No one should be treated like this. Stay strong Queen!! You deserve better #FreeBritney.”

Actress and activist Rose McGowan tweeted: “Britney Spears has every right to be angry. How would you feel if your life was stolen, dissected, mocked? I pray she gets to live your life on her terms. STOP CONTROLLING WOMEN.”

Actress Keke Palmer wrote: “Got y’all asses!! ITS OVER #FreeBritney crazy mfs.”

Rachel Zegler, who will appear in Steven Spielberg’s West Side Story, tweeted: “Free Britney.”

US singer-songwriter Brandy said: “Sending all my love and support to Britney Spears and her fans.”

Singer Tinashe tweeted: “We love you SO MUCH @britneyspears.”

Meghan McCain, a TV personality and daughter of former US presidential nominee John McCain, suggested the terms of Spears’s conservatorship should be illegal.

“How is what has been done to Britney Spears not a human rights crime?” she said.

“Isolation, controlling her capacity to reproduce without her consent, forcing her to work under inhumane conditions. If she were any other person the people who did this to her would be in jail.”

Comedian Ziwe wrote: “FREE BRITNEY!!!!!!!!!!!”

TV host Andy Cohen tweeted: “#FreeBritney”

During Wednesday’s hearing, judge Brenda Penny said a decision on ending the conservatorship cannot be taken until a request is formally lodged with the court.

Samuel Ingham, Spears’s lawyer, said he will discuss the next steps with the star.