FORT MEADE - US Army private Bradley Manning apologised on Wednesday for leaking secret intelligence files to WikiLeaks and admitted for the first time that he had harmed his country and others.
The 25-year-old soldier, convicted last month of espionage for passing a huge cache of classified US battlefield reports from the wars in Iraq and Afghanistan and diplomatic cables, said he was ready to face punishment.
"I'm sorry that my actions have hurt people and have hurt the United States," he told a military judge, Colonel Denise Lind, at a sentencing hearing at Fort Meade, northeast of Washington.
"I want to go forward," he said. "I understand I must pay the price."
Manning faces up to 90 years in prison for his offenses, which also include computer fraud and breaching military discipline. He was acquitted of a more serious charge of deliberately "aiding the enemy," chiefly Al-Qaeda, which could have landed him in jail for life without parole.
Wednesday's dramatic court statement marked the first time Manning had publicly expressed regret over the leaks, the biggest intelligence breach in US history, which led to his arrest in 2010.
WikiLeaks founder Julian Assange suggested in a statement on behalf of the anti-secrecy website that Manning's testimony had effectively been coerced, after the stress of a lengthy trial and more than three years in jail.
"The only currency this military court will take is Bradley Manning's humiliation," Assange said. "In light of this, Mr. Manning's forced decision to apologize to the US government in the hope of shaving a decade or more off his sentence must be regarded with compassion and understanding."
Manning, a former intelligence analyst who obtained the files when he was deployed in Iraq, has become a hero to his supporters, who see him as a whistleblower who lifted the lid on America's foreign policy.
More than 100,000 people have signed a petition calling for his nomination for a Nobel Peace Prize.
But the US government has painted him as a reckless traitor who put his fellow soldiers and country in danger when he handed over some 700,000 documents to WikiLeaks, which published them.
Manning's defense team has argued that he was a naive but well-intentioned young man who hoped to spark a public debate over the conduct of American diplomats and troops abroad.
"Bradley is certainly a person who had his heart in the right place and he was thinking about you ... the American public," defense lawyer David Coombs said Wednesday.
"His one goal was to make this world a better place."
The defense contends that Manning's superiors ignored repeated signs of his emotional distress and should never have allowed him to deploy to Iraq or retain his security clearance.
In poignant testimony Wednesday, Manning's older sister Casey Major and his aunt Debra van Alstyne talked about the soldier's traumatic childhood, when he was often abandoned by his alcoholic parents.
They described his mother as "very mean" and suicidal, saying he was often left alone on the family's rural farm in Oklahoma and fed baby food until the age of 12. "It's amazing how much he matured. I just hope he can be who he wants to be, just be happy," his sister said.
Earlier at the sentencing hearing, experts testified that Manning was plunged into a solitary anguish as he struggled over his sexual identity while living in a "hostile" military environment.
"Being in the military and having a gender issue does not exactly go hand-in-hand," Captain Michael Worsley, a military clinical psychologist, told the court.
"At the time, the military was not exactly friendly towards the gay community."
Worsley diagnosed Manning with a personality disorder and then a "gender identity disorder," and said the soldier would have faced an agonizing plight in the macho world of the military.
"The pressure would have been incredible in an almost openly hostile environment," the doctor told the court.
Manning "was super-critical of himself. He was feeling he was never good enough."
Another witness for the defense, David Moulton, a psychiatrist and expert in military criminal cases, said Manning was facing "hyper stress" at the time of his illegal actions.
"He was under severe emotional stress" when he began "considering living as a woman," he said.
Striving for "something great" in his life, Manning believed he was fulfilling a moral obligation with his leaks, Moulton said. "He was under the impression that the information he leaked was going to change the world," he said. "In his opinion, it would lead to a greater good."