US President Barack Obama has come under fire from top Republicans for his decision to commute the Sentence of Chelsea Manning, who leaked documents to Wikileaks in 2010.
But White House spokesman Josh Earnest said the time already served by Manning was an appropriate punishment.
The 29-year-old transgender US Army private, born Bradley Manning, will be freed on 17 May.
She had been scheduled to be released in 2045.
Manning was sentenced to 35 years in 2013 for her role in leaking diplomatic cables to the anti-secrecy group, one of the largest breaches of classified material in US history.
The commutation reduces Manning's sentence but is not a pardon, which some campaigners had called for.
Senator John McCain, chairman of the Senate Armed Services Committee, called it a "grave mistake".
He said in a statement: "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 organisation that was a tool of Russia's recent interference in our elections.
"Her prison sentence may end in a few months' time, but her dishonour will last forever," he said.
Mr Ryan said President Obama "now leaves in place a dangerous precedent that those who compromise our national security won't be held accountable for their crimes".
White House press secretary Josh Earnest hit back at Republican criticism, suggesting the party was being hypocritical given President-elect Donald Trump has praised Wikileaks.
The group released hacked Democratic Party emails during the election campaign.
"It is outrageous for them to suggest that right now what Chelsea Manning did is worse than what the man who they endorsed for president did," he told CBS News.
He also told CNN that Mr Obama believed Manning had served an "appropriate punishment", having been jailed for nearly seven years.