US soldier Bradley Manning has been sentenced to 35 years in prison for his involvement in leaking large numbers of secret documents to Wikileaks.

Last week, at a sentencing hearing, Manning apologised for hurting his country – although his supporters felt the confession had been forced.

Ahead of the 25-year-old’s statement, Navy Captain David Moulton, a psychiatrist, testified at the time of the 2010 leak that Manning felt abandoned by friends and family and had hit a rough patch with his boyfriend amid an isolating deployment.

The psychiatrist interviewed Manning for 21 hours after his arrest in 2010.

Manning had also decided he wanted to become a woman, Capt Moulton said.

In psychiatric terms, Manning has a “gender identity disorder”, or “disturbance of one’s gender”, Capt Moulton said.

This is different from being gay, he added.

Manning had previously claimed that he had been bullied over his sexuality during his time in the US Army - and he was reportedly disowned by his family after coming out.

In 2011, his father revealed he had “twisted his arm” to get him to join the army.

The Obama administration said the leaks threatened valuable military and diplomatic sources – but his supporters say Manning’s efforts exposed alleged war crimes carried out by the US military in Iraq.

Prosecutors had asked for a 60-year sentence. Manning showed no emotion as the sentence was delivered on Wednesday.

Judge Col Denise Lind declared Manning would be dishonourably discharged from the US Army and forfeit some of his pay.

He was convicted in July on multiple espionage charges.