Chelsea Manning, the former US intelligence analyst, has been released from prison after she was jailed for refusing to testify to a grand jury investigating WikiLeaks.

Ms Manning spent 62 days in jail on contempt charges but was released as the term of the grand jury she was supposed to give evidence to expired.

However, the former army employee, who served seven years of a 35-year sentence for handing a huge trove of confidential documents to WikiLeaks, could be back in jail within a week.

She has received another subpoena demanding she testify to a new grand jury, opening on 16 May.

Under US federal law, a person subpoenaed by a grand jury can be jailed on a civil contempt charge if judges believe it has a chance of coercing them to give evidence.

Earlier this week, Ms Manning’s lawyers filed court papers arguing that she should not be jailed again because she has proven that she will stick to her principles and will not testify no matter how long she is jailed.

If a judge were to determine that incarcerating Ms Manning were punitive rather than coercive, she would not be jailed.

“At this point, given the sacrifices she has already made, her strong principles, her strong and growing support community, and the disgrace attendant to her capitulation, it is inconceivable that Chelsea Manning will ever change her mind about her refusal to cooperate with the grand jury,” her lawyers wrote.

Key moments for Julian Assange Show all 9 1 /9 Key moments for Julian Assange Key moments for Julian Assange The situation today Assange was arrested after Metropolitan Police officers were invited into the Ecuadorian embassy on April 11 2019. How did it come to this? Ruptly TV Key moments for Julian Assange The break Assange shows the front page of the Guardian on July 26 2010, the day that they broke the story of the thousands of military files leaked by WikiLeaks AFP/Getty Key moments for Julian Assange Wanted A warrant for Assange's arrest was issued in August 2010 for counts of rape and molestation in Sweden AFP/Getty Key moments for Julian Assange Ruling The UK's Supreme Court ruled in 2012 that Assange should be extradited to Sweden to face trial Getty Key moments for Julian Assange Sanctuary Following the ruling, Assange was given asylum by the Ecuadorian governement over fears that his human rights would be violated if he were extradited, he has since remained in the embassy in London Getty Key moments for Julian Assange A friend in Pam Friend Pamela Anderson delivers lunch to Assange at the embassy in October 2016. She has since spoken against his arrest Getty Key moments for Julian Assange Arbitrarily detained A UN panel found in 2016 that Assange had been arbitrarily detained and that he had not been able to claim his full right to asylum. It urged Sweden to withdraw the charges against him Getty Key moments for Julian Assange The cat ultimatum Last year, the Ecuadorian embassy threatened to revoke Assange's internet access unless he stopped making political statements online and started taking better care of James, his pet cat. Assange accused Ecuador of violating his rights Reuters Key moments for Julian Assange Arrest Assange was arrested on April 11 2019. Ecuador revoked his asylum status and invited the Metropolitan Police in to the embassy to arrest him. Reuters

Ms Manning filed an eight-page statement with the court on Monday outlining her resolve.

“Cooperation with this grand jury is simply not an option. Doing so would mean throwing away all of my principles, accomplishments, sacrifices, and erase decades of my reputation – an obvious impossibility,” she wrote.

Support free-thinking journalism and attend Independent events

She also said she was suffering disproportionately in jail because of physical problems related to inadequate follow-up care to gender-reassignment surgery.

Ms Manning was working for the army in Iraq in 2010 when she was arrested and accused of leaking 700,000 documents, diplomatic cables and videos.

She was accused of putting the lives of American soldiers at risk, but said she acted in order to open up debate about US foreign policy.

Her 35-year sentence was the longest for leaking in US history and president Barack Obama referred to it as “disproportionate” to her crimes. He commuted the remainder of her sentence in 2017, just before leaving office.