A US judge on Thursday ordered former US military intelligence analyst Chelsea Manning released from jail, a day after a support group said she tried to kill herself.

She had been imprisoned since May 16 last year for refusing to appear before a grand jury targeting anti-secrecy group WikiLeaks.

Because the grand jury was discharged on Thursday, "the court finds that Ms Manning's appearance before the grand jury is no longer needed, in light of which her detention no longer serves any coercive purpose," US District Judge Anthony Trenga wrote in his decision from Alexandria, Virginia, just outside Washington.

However, the judge ordered Manning, 32, to pay $256,000 in fines levied for her refusal to testify.

Under the order detaining her last year, Manning was to be held either until she agreed to testify or for the life of the grand jury, but no longer than 18 months.

Manning's leaks years earlier of classified documents related to the wars in Iraq and Afghanistan made her a hero to anti-war and anti-secrecy activists, and her actions helped make WikiLeaks a force in the global anti-secrecy movement.

A US judge ruled that continued detention of Chelsea Manning "no longer serves any coercive purpose"
A US judge ruled that continued detention of Chelsea Manning "no longer serves any coercive purpose" AFP / Tobias SCHWARZ

"I object to this grand jury... as an effort to frighten journalists and publishers, who serve a crucial public good," Manning said in a letter to the court last year, according to the Sparrow Project support group.

Manning has also said she answered all questions about her involvement with WikiLeaks years ago.

The Sparrow Project said on Wednesday that Manning was recovering in a hospital after trying to commit suicide.

Manning was ordered to testify last year for an investigation examining actions by WikiLeaks founder Julian Assange in 2010.

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 into WikiLeaks's hands. The documents exposed cover-ups of possible war crimes and revealed internal US communications about other countries.

Sentenced in 2013 to 35 years in prison, she was released in May 2017 after the commutation of her sentence by president Barack Obama.