US soldier Bradley Manning has been sentenced to 35 years in prison for providing secret files to WikiLeaks in the biggest breach of classified data in US history.
Judge Colonel Denise Lind, who last month convicted him of 20 charges including espionage and theft, could have sentenced him to as many as 90 years in prison, though prosecutors had asked for 60 years.
Manning will also be dishonorably discharged from the US military and forfeit some of his pay, Judge Lind said.
His rank will be reduced to private from private first class.
The 25-year-old will be eligible for parole after serving one-third of his sentence, which will be reduced by the time he has already served in prison, plus 112 days.
Manning turned over more than 700,000 classified files to WikiLeaks.
The leaked material included battlefield videos and diplomatic cables in a case that has commanded international attention since 2010.
Defence attorneys this week pleaded with Col Lind not to "rob him of his youth".
Manning was working as a low-level intelligence analyst in Baghdad when he handed over the documents, catapulting WikiLeaks and its founder, Julian Assange, into the international spotlight.
In July, Col Lind found Manning guilty of 20 criminal counts, but not of aiding the enemy, the most serious charge, which carried a possible sentence of life in prison without parole.
The classified material that shocked many around the world included a 2007 gunsight video of a US Apache helicopter firing at suspected insurgents in Baghdad.
Among the dozen fatalities were two Reuters news staff, and WikiLeaks dubbed the footage "Collateral Murder".
The case highlighted the difficulty of keeping secrets in the internet age.
It raised strong passions on the part of the US government, which said Manning had put US lives at risk, and anti-secrecy advocates, who maintained Manning was justified in releasing the information.
A US rights group has said Manning should be a candidate for this year's Nobel Peace Prize.
Manning's trial at Fort Meade, Maryland, home of the ultra-secret National Security Agency (NSA), wound down as the US continues to seek the return of Edward Snowden.
The former NSA contractor, who disclosed details of US programmes that included monitoring the telephone and internet traffic of US citizens, has been given temporary asylum in Russia.
The Guardian newspaper reported yesterday that British authorities had forced it to destroy the materials leaked by Mr Snowden.
Manning's defence argued that his aim had been to spark a broader debate on the role of the US military and make Americans aware of the nature of wars in Iraq and Afghanistan.
According to defence testimony, military supervisors ignored erratic behaviour on the part of Manning, which included trying to grab a gun during a counselling session.
Defence attorneys argued that such actions demonstrated that the slightly built Manning, who was increasingly isolated while deployed to Iraq, had not been fit for duty overseas.
During a pre-trial hearing, Col Lind reduced Manning's sentence by 112 days because of harsh treatment after his arrest in 2010. He likely will be imprisoned at the US Disciplinary Barracks at Fort Leavenworth, Kansas.
Manning pleaded guilty to lesser charges earlier this year, but military prosecutors continued their efforts to convict him on more serious counts.
Manning apologised to the court last week for what he had done, saying: "I understand I must pay a price for my decisions."
WikiLeaks said the 35-year jail term handed down to Manning was a "strategic victory" as it meant he was eligible for parole in less than nine years.
The Bradley Manning Support Network, a group backing the soldier, said in a statement it plans to seek clemency from army officials after sentencing.
The Support Network also said that Manning's attorney, David Coombs, will ask for a pardon from US President Barack Obama.