Chelsea Manning, who leaked thousands of confidential documents relating to the United States military and diplomacy, has had most of her sentence commuted by President Barack Obama.
Ms Manning has been in jail for nearly seven years of a 35-year sentence for the 2010 leak, and Mr Obama's decision saves her from an uncertain future as a transgender woman at a male military prison. She was convicted under her male name Bradley.
In a White House announcement on Tuesday (local time), Mr Obama said she'd now be free in five months' time, rather than in 2045.
In 2009, Manning, then a low-level intelligence analyst, provided the documents to WikiLeaks which included military incident logs from the Afghanistan and Iraq wars as well as around 250,000 diplomatic cables from American embassies around the world.
At the time, she said she wanted to make the documents public to spark "worldwide discussion, debates and reforms".
The massive leak had ramifications for the Obama administration for years; there were fears for the safety of those in dangerous foreign countries identified as having been helped by US diplomats or troops. But prosecutors provided no evidence anyone was killed as a result of the leaks.
Manning was court martialled and was found guilty of 20 charges, including six under the Espionage Act. She was acquitted of the charge of "aiding the enemy".
Her 35-year sentence was by far the longest for a conviction of leaking information.
While the Obama administration has shown clemency to Manning, it doesn't seem to be taking the same stance with Edward Snowden, a former intelligence contractor who made public top-secret surveillance files, despite a petition to pardon him.
Snowden is currently living as a fugitive in Russia.
Manning was one of 209 other prisoners who have had their sentences shortened; 64 others have been pardoned by Mr Obama.
During Mr Obama's presidency, he commuted sentences of 1385 people the most of any president in the country's history.
Of those, 504 were life sentences, which is more than the past 12 presidents combined.