President Obama has commuted the majority of the remaining prison sentence of Army whistleblower Chelsea Manning, who was sentenced to 35 years in military prison in 2013 for leaking hundreds of thousands of documents to Wikileaks. Manning will be released on May 17 from Fort Leavenworth Military Prison, where she would otherwise have been detained until 2045.

While serving as an army intelligence analyst, Manning sent hundreds of thousands of classified diplomatic and military documents to Wikileaks, revealing, among other things, a dramatically higher civilian death count in Iraq and Afghanistan than the Pentagon revealed publicly, and the chilling video of a U.S. Apache helicopter gunning down journalists in central Baghdad.

White House spokesperson Josh Earnest spoke about the possibility of clemency on Friday, saying Manning was “exposed to due process, was found guilty,” and that she “acknowledged wrongdoing.” He also appeared to close the door on last-minute clemency for other whistleblowers, saying NSA whistleblower Edward Snowden revealed material that is “far more serious and far more dangerous.”

Even with her sentence commuted, Manning will have spent more time in detention than anyone convicted of leaking to news organizations: Just under seven years. After being arrested in 2010, she endured 11 months of solitary confinement, and was repeatedly denied medical care for her gender dysphoria.

In September, Manning staged a five-day hunger strike, and ended it only after the Army allowed her to consult a surgeon to receive gender-affirming surgery. Later that month, the Army punished Manning in retaliation for a suicide attempt, and she spent a week in solitary confinement.

Human rights activists and lawyers for Manning celebrated the decision.

“I’m relieved and thankful that the president is doing the right thing and commuting Chelsea Manning’s sentence,” said Chase Strangio, an attorney with the ACLU representing Manning, 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 move was quickly hailed by human rights groups. “Instead of punishing the messenger, the U.S. government can send a strong signal to the world that it is serious about investigating the human rights violations exposed by the leaks and bringing all those suspected of criminal responsible to justice in fair trials,” said Erika Guevara-Rosas, Americas Director at Amnesty International.

[Disclosure: First Look Media Works, Inc., publisher of The Intercept, made a $50,000 matching-fund donation to Chelsea Manning’s legal defense fund through its Press Freedom Litigation Fund, and Glenn Greenwald, a founding editor of The Intercept, donated $10,000.]

Top Photo: A photo of Pfc. Chelsea Manning, provided by the Army.