A US judge has ordered the immediate release of former army intelligence analyst Chelsea Manning from prison.
Manning had been remanded for refusing to testify in an inquiry into Wikileaks and had been in detention in Virginia since last May.
She was scheduled to appear in court on Friday, but the judge ruled that it was no longer necessary for her to testify.
Manning was found guilty in 2013 of charges including espionage for leaking secret military files to Wikileaks.
She accrued more than $250,000 (£198,000) in fines for refusing to co-operate with the inquiry. Her legal team had asked for these to be vacated, but the judge said they must be paid in full.
Manning, 32, refused to answer further questions about Wikileaks from investigators because she said she had already given her testimony during the 2013 trial.
Her release order on Thursday came shortly after her legal team said she had tried to take her own life and was recovering in hospital.
Police confirmed there was “an incident” involving Manning at the detention centre in Virginia on Wednesday afternoon. “It was handled appropriately by our professional staff and [she] is safe,” a police statement said.
US prosecutors have been investigating Wikileaks for several years.
They are currently seeking the extradition of its co-founder Julian Assange from the UK over his alleged role in the release of classified military and diplomatic material in 2010.
Australian-born Assange faces a charge of conspiracy to commit computer intrusion in the US.