After being arrested in 2010, she filed a transgender rights case in prison and attempted suicide twice last year, according to her lawyers.

They refused to give details of how she would be freed over security concerns for the transgender soldier, who was known as Bradley Manning before transitioning in prison.

She was convicted in 2013 of 20 charges, including six Espionage Act violations, theft and computer fraud, but was acquitted of the most serious charge of aiding the enemy.

The diplomatic cables and military files she passed to WikiLeaks, gained on assignment as an Army intelligence analyst, exposed abuses in Iraq and Afghanistan by the American military and provoked global outrage.

They included secret documents on the treatment of detainees at Guantanamo Bay, killings by military contractors in Iraq, civilian deaths in Afghanistan and individual incidents including the killing of two Reuters war correspondents in Baghdad.

Ms Manning said she wanted to expose the US military's alleged disregard of the effects of war on civilians and chose to release information that she believed would not harm the US.

Critics said the leaks laid bare some of the nation's most-sensitive secrets and endangered information sources, prompting the State Department to move to protect their safety.

Several ambassadors were recalled, expelled or reassigned because of embarrassing disclosures.

Mr Obama's decision to commute Ms Manning's sentence to about seven years, including the time she spent in custody before being convicted, drew strong criticism from some American politicians including Republican House Speaker Paul Ryan, who called the move “outrageous”.

The Obama administration argued the case was fundamentally different to that of former National Security Agency contractor Edward Snowden, who fled to Russia after leaking documents on its secretive spying programme.

“It has been my view that given she went to trial, that due process was carried out, that she took responsibility for her crime, that the sentence that she received was very disproportionate relative to other leakers,” Mr Obama said at the time, stressing that he was not pardoning Ms Manning but believed “justice has been served”.

In a statement last week, Ms Manning thanked that former President and said that letters of support from veterans and fellow transgender people inspired her “to work toward making life better for others.”

“For the first time, I can see a future for myself as Chelsea,” she said.

“I can imagine surviving and living as the person who I am and can finally be in the outside world. Freedom used to be something that I dreamed of but never allowed myself to fully imagine.”

Ms Manning’s representatives said she was subjected to violence in prison and argued the military mistreated her by requiring her to serve her sentence in an all-male prison, restricting her physical and mental health care and not allowing her to keep a “feminine” haircut.

The Army said she would remain on active duty in a special, unpaid status of “excess leave” that will legally entitle her to military medical care along with commissary privileges, while her court-martial conviction is under review.