FORT MEADE, Maryland (CNN) -

Army private Bradley Manning, charged in the largest leak of classified material in American history, spoke at length on Thursday about his treatment in military custody, saying he grew distressed and considered suicide.

In a clear voice and often gesturing with his hands at a hearing at Ft. Meade, Maryland, the bespectacled Manning described his experiences publicly for the first time since his arrest more than two years ago.

The hearing was held to consider a defense motion to have his case dismissed on grounds that his confinement so far, especially his time at the brig in Quantico, Virginia, has been harsh and has amounted to enough punishment.

At the very least, his lawyers hope the judge would take his experiences during confinement into account and sharply reduce his sentence should he be convicted at his court-martial, which is set to begin early next year.

The defense has said it plans to have Manning plead guilty to lesser offenses and fight other charges as being too extreme.

The Army intelligence analyst is accused of stealing thousands of classified documents while serving in Iraq. The material was then published online by WikiLeaks. WikiLeaks has never confirmed that Manning was the source of its information.

Counts against Manning include aiding the enemy, wrongfully causing intelligence to be published on the Internet, transmitting national defense information and theft of public property or records.

If he's convicted on all counts, he could face a life sentence.

He discussed his arrest in Iraq and his transfer to Kuwait, where he was held for a nearly two months before being transferred to the brig at Marine Base Quantico in Virginia in July 2010.

He said he once passed out due to the heat. He also said not being allowed to know what was happening to him or in the outside world was distressing.

He contemplated suicide in Kuwait.

"My world just shrunk to Camp Arafjon, to that cage," Manning said. "I thought I was going to die in that cage."

A Navy psychiatrist testified on Wednesday that he believed Manning was a potential suicide risk when he arrived at the Quantico brig, where he was held from July 2010 until April 2011, when he was moved to the military prison at Fort Leavenworth, Kansas.

But Capt. William Hocter said his regular recommendations to ease Manning's heightened confinement status within weeks of his arrival in Virginia were not acted upon by commanders.

"The degree of concern of his safety and security was higher than anything I'd previously seen," Hocter said of Manning's time at Quantico.

The Pentagon has maintained Manning was held in accordance with rules governing all maximum-custody detainees at Quantico, for his protection and the safety of others. His status was called prevention of injury.

Manning said he spent most days at Quantico in his small cell -- at least 21 hours and often more than 23 hours -- with no company. Manning said he was only allowed a mattress, blanket, flip-flops, some clothes and his glasses.

He said he tried to keep moving, because sleeping during the day or even laying down was against the rules.

He was seen dancing by himself in his cell, with no music or playing "peek-a-boo" with himself in the cell mirror. Manning explained that he wasn't acting crazy.

"I'm bored, not a lot going on, not a lot to do," he said.