FORT MEADE, Md. -- A U.S. Army private accused of sending classified U.S. documents to the secret-spilling website WikiLeaks was kept in solitary confinement, sometimes naked, for months partly because another prisoner had recently committed suicide, the former security chief at the military base where Bradley Manning was held testified Wednesday.

Marine Col. Robert Oltman spoke at a pretrial hearing, where Manning is expected to testify later this week.

Manning's lawyers are seeking dismissal of all charges, claiming his confinement at a Marine brig in Virginia amounted to illegal punishment.

The 24-year-old Manning was locked up alone for at least 23 hours a day, forced to sleep naked for several nights and forced to stand naked at attention one morning, his lawyers say. He was designated a "maximum custody" detainee and considered at risk of either killing himself or harming himself or others.

After he was moved to Fort Leavenworth in Kansas in April 2011, Manning was re-evaluated and given a medium-security classification.

Manning is accused of sending hundreds of thousands of classified Iraq and Afghanistan war logs and more than 250,000 diplomatic cables to WikiLeaks while he was working as an intelligence analyst in Baghdad in 2009 and 2010.

He faces possible life imprisonment if convicted of aiding the enemy, the most serious of the 22 charges that he faces.

Oltman and others have testified that psychiatrists who examined Manning at the Marine brig repeatedly recommended that his conditions be eased. But Oltman said he was skeptical about at least one of those recommendations because another detainee had killed himself in December 2009 after his custody status was reduced based on the advice of Navy Capt. William Hochter, the psychiatrist assigned to the brig.

"He didn't have the strongest credibility with me with regards to his recommendations," Oltman said under questioning by civilian defence attorney David Coombs.

Oltman acknowledged he told Hochter: "'Nothing's going to change. He won't be able to hurt himself. He's not going to be able to get away, and our way of ensuring this is that he will remain on this status indefinitely."

One of the security measures was the removal of Manning's underwear at night, starting March 2, 2011, after he told the brig commander that if he wanted to kill himself, he could hang himself with the waistband.

Coombs suggested Manning was commenting on the absurdity of his situation.

Coombs produced an email in which the brig's chief legal officer at the time, Lt. Col. Christopher Greer, made light of the underwear episode with a Dr. Seuss parody: "I can wear them in a box. I can wear them with a fox. I can wear them in the day. I can wear them so I say. But I can't wear them at night. My comments gave the staff a fright," Coombs read.

Oltman acknowledged that he responded to the email with the signature, "Sam I am," another Dr. Seuss reference.

"Was it funny to you that Pfc. Manning was being stripped at night?" Coombs asked.

"No, it was not, it was a very serious issue," Oltman said.

At least a dozen supporters of Manning attended the second day of what is expected to be a six-day hearing.

The materials Manning is suspected of leaking include sensitive reports on foreign governments and leaders and a 2007 video clip of a U.S. helicopter crew gunning down 11 men, including a Reuters news photographer and his driver. The video drew worldwide attention. The Pentagon concluded the troops acted appropriately during the attack, having mistaken the camera equipment for weapons.