President Obama commuted the majority of the 35-year sentence faced by Chelsea Manning, a former Army intelligence analyst and whistleblower who supplied diplomatic and military documents to WikiLeaks .

Manning, who came out as a transgender woman following her trial, has been incarcerated in an all-male military prison in Ft. Leavenworth for almost seven years and has twice attempted suicide during her incarceration.

“I’m relieved and thankful that the president is doing the right thing and commuting Chelsea Manning’s sentence,” Chase Strangio, an American Civil Liberties Union attorney who represents Manning, said in a statement. “Since she was first taken into custody, Chelsea has been subjected to long stretches of solitary confinement — including for attempting suicide — and has been denied access to medically necessary health care. This move could quite literally save Chelsea’s life, and we are all better off knowing that Chelsea Manning will walk out of prison a free woman, dedicated to making the world a better place and fighting for justice for so many.”

The terms of Obama’s commutation will have Manning freed on May 17, 2017, The New York Times reports. His administration recently hinted that it saw her case for commutation as stronger than the push for pardon of another high-profile whistleblower, Edward Snowden. White House press secretary Josh Earnest noted a “stark difference” between the Manning and Snowden cases.

“Chelsea Manning is somebody who went through the military criminal justice process, was exposed to due process, was found guilty, was sentenced for her crimes, and she acknowledged wrongdoing,” Earnest explained. “Mr. Snowden fled into the arms of an adversary, and has sought refuge in a country that most recently made a concerted effort to undermine confidence in our democracy.”

Snowden congratulated Manning on her release via Twitter and thanked Obama for issuing the commutation.

Let it be said here in earnest, with good heart: Thanks, Obama. https://t.co/IeumTasRNN — Edward Snowden (@Snowden) January 17, 2017

Manning was among 209 individuals granted a commutation by Obama today, bringing his total commutations to 1,385 — the most of any president in history. The president also pardoned 64 individuals.

Manning — who, under her sentence, would not have been freed until the year 2045 — was deployed in Iraq in 2009. Her role as an intelligence analyst gave her access to classified material, and she later shared military logs and diplomatic cables with WikiLeaks. She said she hoped the disclosures, including video of a helicopter attack that killed journalists and evidence of civilian deaths, would inspire “worldwide discussion, debates, and reforms.”

“I will officially give up on the society we have if nothing happens” as a result of the leaks, she wrote.

During her incarceration, Manning became an icon in the struggle for transgender rights. She has pushed the military for adequate medical care and acknowledgment of her gender.

“Obama may well have just saved Chelsea Manning’s life. Freeing her is clearly and unambiguously the right thing to do, and not just for the obvious humanitarian reasons, though those are absolutely compelling,” said Sarah Harrison, acting director of Courage, an organization that contributes to Manning’s legal defense fund. “Chelsea deserves her freedom, and the world’s respect, for her courageous, inspiring actions in 2010. Chelsea’s releases through WikiLeaks helped bring an end to the US war on Iraq, galvanised Arab Spring protesters and inspired subsequent truthtellers. Chelsea should also be admired for the way she has drawn international attention to battles for transgender rights and against prison abuse, in some of the most difficult circumstances imaginable.”