President Barack Obama has commuted the sentence of Chelsea Manning, the former U.S. Army analyst convicted of espionage and a host of other charges for leaking hundreds of thousands of secret documents to WikiLeaks.

The former Army private, who went by the name of Bradley Manning before undergoing a sex change operation last fall, is serving what would have been a 35-year sentence in the Army’s Fort Leavenworth Prison in Kansas after being convicted of providing nearly 750,000 documents to Wikileaks in 2010. Many of those documents contained classified information about U.S.

military activities in Iraq and Afghanistan, as well as sensitive diplomatic communications.

In commuting Manning’s sentence on Tuesday, Obama also commuted the sentences of 208 other prison inmates and pardoned 64 others. The White House says the president has now commuted the sentences of 1,385 people serving time on various charges -- the most grants of commutation issued by any president in U.S. history.

Bradley considered 'whistleblower' by some, threat to others

Bradley has been lauded by some as a whistleblower for leaking the documents while serving in Army intelligence, but critics said by revealing military and diplomatic secrets American lives had been endangered. In a statement released to the media Tuesday afternoon Arizona Republican Senator John McCain, who chairs the Senate Armed Services Committee, blasted the move by the president, saying it would encourage more espionage against the U.S.

“It is a sad, yet perhaps fitting commentary on President Obama’s failed national security policies that he would commute the sentence of an individual that endangered the lives of American troops, diplomats, and intelligence sources by leaking hundreds of thousands of sensitive government documents to Wikileaks, a virulently anti-American organization that was a tool of Russia’s recent interference in our elections,’ McCain said in the statement.

CNN: Defense Department official 'shocked'

Indeed, CNN reports the decision by the president “shocked” a senior Defense Department official, who told the network the move was made over the objections of Secretary of Defense Ash Carter. CNN says the official, who it did not name, said the intelligence community was “deflated” by the decision.

ACLU, WikiLeaks applaud decision

But the American Civil Liberties Union, which had previously filed a friend-of-the-court brief in support of Manning, applauded the move by the president. In a statement the ACLU said that Manning had raised public awareness of war’s impact on civilians.

“I’m relieved and thankful that the president is doing the right thing and commuting Chelsea Manning’s sentence,” Chase Strangio, a staff attorney with the union's LGBT Project, said in the statement.

WikiLeaks also celebrated the decision, calling it "victory" and thanking activists who supported Manning. WikiLeaks posted a statement from Manning's lawyers, Nancy Hollander and Vince Ward, who called Manning the “longest serving whistleblower in the history of the United States.”

With her sentence being commuted Manning will be released from prison on May 17. Otherwise she would have remained behind bars until 2045.