A judge has sentenced Bradley Manning to 35 years in prison for providing a trove of classified documents to anti-secrecy website WikiLeaks.
The judge convicted the 25-year-old in July of 20 offences, including six violations of the Espionage Act.
Prosecutors had asked for at least 60 years in prison. Manning's lawyer suggested no more than 25 because by then, some of the documents Manning leaked will be declassified.
Last week, Manning apologised for hurting the US and for "the unexpected results" of his actions.
He will receive credit for three-and-a-half years, but be dishonourably discharged from the US Army.
Manning leaked more than 700,000 Iraq and Afghanistan battlefield reports and State Department diplomatic cables in 2010 while working as an intelligence analyst in Iraq.
He was convicted last month of 20 offences, including six Espionage Act violations, five theft counts and computer fraud. Prosecutors were unable to prove that he aided the enemy, a crime punishable by life in prison.
Manning has apologised and said he wanted to provoke a debate on the country's military and diplomatic actions.
"I believed I was going to help people, not hurt people," he said last week.
His defence team said he was under severe mental pressure as a young man struggling with gender identity issues at a time when openly gay people were not allowed to serve in the US military.
Prosecutors said the leaks endangered the lives of US intelligence sources and prompted several ambassadors to be recalled, reassigned or expelled.
Prosecutors requested a far longer prison term than other soldiers have received in recent decades for sharing government secrets.
Albert T. Sombolay got a 34-year-sentence in 1991 for giving a Jordanian intelligence agent information on the buildup for the first Iraq war, plus other documents and samples of US Army chemical protection equipment. Clayton Lonetree, the only Marine ever convicted of espionage, was given a 30-year sentence, later reduced to 15 years, for giving the Soviet KGB the identities of US CIA agents and the floor plans of the embassies in Moscow and Vienna in the early 1980s.
Amnesty International and the Bradley Manning Support Network have announced an online petition asking US President Barack Obama to pardon Manning.Military prisoners can earn up to 120 days a year off their sentence for good behaviour and job performance, but they must serve at least one-third of any prison sentence before they can become eligible for parole.