Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

President Obama has commuted the sentence of Chelsea Manning, the former Army intelligence analyst who is serving 35 years for giving classified information to WikiLeaks, the White House announced Tuesday.

The decision, made in the last days of Obama's presidency, means that Manning can be freed May 17, seven years into a prison term that has been marked by two suicide attempts and a hunger strike aimed at obtaining sex reassignment surgery.

"I think justice was finally done today," Manning's lawyer, David Coombs, told NBC News. "Thirty-five years was not an appropriate sentence. Seven years is still too long, but at least Chelsea now will be able to return to her life, return to her family and to the people who love her."

In addition to shaving 28 years off Manning's sentence, Obama granted 208 other commutations and 64 pardons — including one for retired Gen. James Cartwright, who was accused of lying to the FBI during another leak investigation.

Related: Some Big Names Got a Measure of Mercy From President Obama

The Manning commutation, which will undoubtedly be controversial, was not a complete surprise.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

NBC News reported last week that she was on the president's short list. And at a briefing last week, White House spokesman Josh Earnest said that Manning's actions were not as "dangerous" as those of fugitive leaker Edward Snowden. Earnest also noted that Manning had answered for her actions in court, and admitted wrongdoing.

More than 117,000 people signed a petition asking the White House to consider the commutation. Snowden, whose supporters had petitioned for clemency, tweeted that if Obama could only free one person, it should be Manning.

Mr. President, if you grant only one act of clemency as you exit the White House, please: free Chelsea Manning. You alone can save her life. — Edward Snowden (@Snowden) January 11, 2017

WikiLeaks tweeted last week that founder Julian Assange would agree to be extradited to the U.S. if Obama granted clemency to Manning, but the status of that offer was unclear.

White House officials said Wikileaks' statement played no role in the decision. They noted that Manning had accepted responsibility, expressed remorse and served time.

Evan Greer of Fight for the Future, the organization that sponsored the petition, said she was "overjoyed" at the news.

"I think her freedom and this news today is a testament to the power of grassroots organizing," Greer said. "I think Chelsea showed incredible courage herself and that inspired her supporters to persevere even when it seemed like freedom was completely impossible."

House Speaker Paul Ryan called the commutation "outrageous" and said it set "a dangerous precedent that those who compromise our national security won’t be held accountable for their crimes.”

Chelsea Manning, then known as Bradley Manning, leaves a military court facility in 2013. SAUL LOEB / AFP - Getty Images

Sen. Tom Cotton, R-Ark., blasted the decision.

"When I was leading soldiers in Afghanistan, Private Manning was undermining us by leaking hundreds of thousands of classified documents to WikiLeaks," he said.

"I don’t understand why the president would feel special compassion for someone who endangered the lives of our troops, diplomats, intelligence officers, and allies. We ought not treat a traitor like a martyr."

Manning — then known as Bradley — was locked up in 2010 after swiping 700,000 military files and diplomatic cables and giving them to WikiLeaks. No document was classified higher than secret and her defenders say no one was endangered by the leaks.

At trial, prosecutors said she was a dangerous traitor, while her lawyers portrayed her as a naive whistleblower. The day after her sentencing, she announced she was a transgender woman.

Three years ago, Manning applied for a presidential pardon and was rejected. In her petition this November to have her sentence commuted, she said she understood her earlier request was "too soon" and "too much."

"I should have waited. I needed time to absorb the conviction, and to reflect on my actions. I also needed time to grow and mature as a person," she wrote.

"I take full and complete responsibility for my decision to disclose these materials to the public. I have never made any excuses for what I did. I pleaded guilty without the protection of a plea agreement because I believed the military justice system would understand my motivation for the disclosure and sentence me fairly. I was wrong."

In her plea to Obama, she said she has not been able to get proper treatment for an anxiety-producing condition called gender dysphoria while incarcerated at the military prison in Leavenworth, Kansas.

"The bottom-line is this: I need help and I am still not getting it. I am living through a cycle of anxiety, anger, hopelessness, loss, and depression. I cannot focus. I cannot sleep. I attempted to take my own life," she wrote in her petition.