Washington (AFP) - Chelsea Manning, who spent more than three years in prison for leaking US military secrets to WikiLeaks, was jailed again Friday for refusing to testify in a grand jury investigation targeting the anti-secrecy group.

US District Judge Claude Hilton ruled Manning in contempt of court and ordered her held not as punishment but to force her testimony in the secret case, according to a spokesman for the US attorney in the Alexandria, Virginia federal court.

"Chelsea Manning has been remanded into federal custody for her refusal to provide testimony," said a statement from the Sparrow Project, a support group for Manning.

They quoted Hilton as saying Manning would be held indefinitely "until she purges or the end of the life of the grand jury."

In a statement, Manning said she had "ethical" objections to the grand jury system and had answered all questions about her involvement with WikiLeaks years ago.

"I stand by my previous testimony," Manning said.

"I will not participate in a secret process that I morally object to, particularly one that has been historically used to entrap and persecute activists for protected political speech."

Manning, 31, was ordered to testify earlier this week for an investigation examining actions by WikiLeaks founder Julian Assange in 2010, according to her own description, inadvertent court revelations and media reports.

At the time Manning, a transgender woman then known as Bradley Manning, was a military intelligence analyst.

She delivered more than 700,000 classified documents related to the wars in Iraq and Afghanistan into WikiLeaks's hands.

The documents exposed cover-ups of possible war crimes and revealed internal US communications about other countries.

- 'Attack on media freedom' -

She became a hero to anti-war and anti-secrecy activists, and her actions helped make WikiLeaks a force in the global anti-secrecy movement.

She was detained in 2010 and held in military jails for investigation before finally being brought to trial in 2013.

Story continues

In August that year she was sentenced to 35 years in prison.

She spent more than three years more in an all-male prison, during which she underwent gender transition therapy, spent time in solitary confinement and attempted suicide twice.

President Barack Obama later commuted her sentence, leading to her release in May 2017.

In court Friday, Manning's lawyer requested home confinement after the judge found her in contempt, according to the US attorney's spokesman.

But she was jailed in the Alexandria Detention Center which, according to the judge, is experienced in holding transgender inmates and capable of addressing any special personal and medical needs Manning may have.

The grand jury investigation could eventually herald a case focused on media freedoms.

The US government has been investigating Assange and WikiLeaks for years and has stepped up its efforts against the Britain-based group after it served as an outlet for internal Democratic communications that Washington alleges were stolen by hackers from Russia's GRU intelligence agency during the 2016 US election.

Fearing arrest and extradition to the United States, Assange has been sheltering in Ecuador's embassy in London since 2012.

He says WikiLeaks's publishing of US secrets is no different than what the mass media does and he should enjoy the same protections as journalists.

Reacting to Manning being sent to jail Friday, WikiLeaks said in a tweet: "Whistleblowers are now being forced to testify against journalists and sent to jail when they don't cooperate. A new angle in the attack on media freedom."