The man who leaked thousands of top-secret diplomatic cables to WikiLeaks has apologised for hurting his country.

At a sentencing hearing in Fort Meade, Maryland, US soldier Bradley Manning, 25, pleaded with a judge for a chance to go to college and become a productive citizen instead of facing up to 90 years in prison.

"I'm sorry that my actions hurt people. I'm sorry that it hurt the United States," Manning said

"I'm apologising for the unexpected results of my actions. The last three years have been a learning experience for me."

In July, military judge Col Denise Lind convicted Manning of 20 charges including espionage, theft and violating computer regulations.

Working as an army intelligence analyst in Iraq in 2010, Manning leaked confidential diplomatic cables, warzone logs and videos to the anti-secrecy website.

"When I made these decisions I believed I was going to help people, not hurt people," Manning said.

"Unfortunately, I can't go back and change things."

Assange's website dismissed the apology as "extracted" by force and "tactical".

"It took three years and millions of dollars to extract two minutes of tactical remorse from this brave soldier," Wikileaks said.

"Manning's forced decision to apologise to the US government in the hope of shaving a decade or more off his sentence must be regarded with compassion and understanding."

Before Manning's statement, a psychiatrist told the court the soldier had a troubled childhood and suffered from gender-identity disorder.

Capt David Moulton said that Manning felt he was a woman trapped in a man's body and that that made him feel alienated in the army.

Moulton said Manning had also symptoms of foetal alcohol syndrome and Asperger syndrome, which is a disorder on the autistic spectrum.

"His decision-making capacity was influenced by the stress of his situation," Moulton said.

Attorneys for Manning contended that his commanders should have spotted signs of his deteriorating mental health and not send him to a war zone to handle classified information.

Manning eventually emailed Capt. Michael Worsley a photo of himself in a blonde wig and lipstick, describing his desire to become a woman and his hope that military life would "get rid of it".

"You put him in that kind of hyper-masculine environment, if you will, with little support and few coping skills, the pressure would have been difficult to say the least," Worsley said. "It would have been incredible."

Manning Wikileaks
US soldier Bradley Manning apologised for hurting his country by leaking classified documents (Reuters) Reuters