Pfc. Bradley Manning was sentenced to 35 years in prison Wednesday, the culmination of a trial that posed tough questions about the balance between government secrecy and national security.

Pfc. Manning was facing a maximum 90-year sentence. The prosecution had asked for 60 years and the defense no more than 25.

After an eight-week court-martial, Pfc. Manning was convicted in July of espionage for downloading volumes of classified military and diplomatic information that he handed to the antisecrecy group WikiLeaks for public release. The presiding judge, Col. Denise Lind, rejected the U.S. government's most serious charge—aiding the enemy—which could have led to a much harsher sentence.

Pfc. Manning, 25 years old, won international notice after his May 2010 arrest at a U.S. military base in Iraq. Supporters, including WikiLeaks founder Julian Assange, hailed Pfc. Manning as a heroic whistleblower who risked his own freedom in an attempt to rouse opposition to American foreign policy and its "war on terror."

The prosecution cast Pfc. Manning as a low-level military analyst who recklessly released classified information that could be used against American troops and their allies around the world.

During the court-martial, Pfc. Manning defended his decision to release the information as an effort to spark a broad debate about American foreign policy. Last week, in a final appeal for leniency, he issued a public apology and cast himself as a misguided young soldier who didn't realize that his actions would hurt the U.S.

"I look back on my decisions and wonder how on earth could I, a junior analyst, possibly believe I could change the world for the better," he told the judge.