President Barack Obama has commuted Chelsea Manning’s sentence for leaking documents to Wikileaks in 2010.
The 29-year-old transgender US Army private, born Bradley Manning, will be freed on 17 May instead of her scheduled 2045 release.
She was sentenced to 35 years in 2013 for her role in leaking diplomatic cables to the anti-secrecy group.
The leak was one of the largest breaches of classified material in US history.
The Obama administration has been under pressure to release Ms Manning, who twice attempted suicide last year at the male military prison where she is being held at Fort Leavenworth, Kansas.
She also went on a hunger strike last year, which ended after the military agreed to provide her with gender dysphoria treatment.
The White House has suggested it was open to commuting Ms Manning’s sentence in recent days, contrasting her situation with Edward Snowden, the former National Security Agency contractor who leaked surveillance documents and is living as a fugitive in Russia.
Wikileaks founder Julian Assange also said last year that he would surrender to US authorities if Mr Obama pardoned Ms Manning.
On Tuesday, President Obama granted commutation of sentence to 209 individuals and pardons to 64 others.