A federal judge ordered the release of former Army intelligence analyst Chelsea Manning on Thursday, just one day after she attempted to take her own life while in prison.

Manning has been in jail since May, in Alexandria, Va., for refusing to testify before a grand jury investigating WikiLeaks.

She told the judge in May that she’d “rather starve to death” than comply with the subpoena.

U.S. District Judge Anthony Trenga ordered Manning's release after prosecutors said the grand jury had been disbanded, The Associated Press reported.

CHELSEA MANNING ATTEMPTS SUICIDE IN JAIL, LEGAL TEAM SAYS

Trenga did, however, leave $256,000 in fines that were levied against Manning in place, for her refusal to provide testimony to the grand jury.

There was a hearing scheduled for Friday, but it has since been canceled. Manning's team argued that she had shown she couldn't be coerced into testifying and should be released.

In a 2019 letter to the judge, Manning called the grand jury probe “an effort to frighten journalists and publishers, who serve a public good.”

Manning was found guilty of espionage and theft in 2013 and was sentenced to 35 years in prison after she leaked classified documents to Wikileaks.

CLICK HERE TO GET THE FOX NEWS APP

U.S. officials claimed the website’s founder, Julian Assange, worked in tandem with Manning to break into a classified government computer and leak information related to U.S. war and diplomacy efforts.

Then-President Obama commuted her sentence in 2017 and she was released from prison after seven years.

Fox News' Morgan Phillips contributed to this report