The harsh conditions forced upon Bradley Manning in military detention have been laid out in detail as part of a court filing in which the US army is accused of a "flagrant violation" of his right not to be punished prior to trial.

The Article 13 motion, published Friday by Manning's civilian lawyer David Coombs on his website, claims that Manning, who is accused of leaking state secrets to WikiLeaks, was held in a 6x8 ft cell for 23 to 24 hours a day. In addition, when not sleeping, Manning was banned from lying down, or even using a wall to support him.

The motion also claims that Manning was punished through "degradation and humiliation", notably by forcing him to stand outside his cell naked during a morning inspection. This, his Coombs claims, was "retaliatory punishment" for speaking out over his treatment.

Manning, 24, is accused of being behind the biggest leak of state secrets in US history. Hundreds of thousands of diplomatic cables from US embassies around the world, as well as war logs from Afghanistan and Iraq, were published by the whistleblowing website WikiLeaks.

The information was provided by Manning from his military base near Baghdad, army prosecutors have claimed. They have indicted Manning on 22 counts, including charges of aiding the enemy – charges that carry a maximum penalty of death, although prosecutors have indicated that they will not seek capital punishment.

Coombs is attempting to get all charges dismissed on the grounds that he was subjected to illegal pre-trial treatment – in violation of the constitutional prohibition of cruel and unusual punishment. The claim relates to the nine months that Manning spent after being transferred to the Quantico marine base in Virginia following his arrest in May 2010.

"Manning was awoken at 0500 hours and required to remain awake in his cell from 0500 to 2200 hours," Coombs claims in the motion, adding that he "was not permitted to lie down on his rack during the duty day. Nor was Manning permitted to lean his back against the cell wall; he had to sit upright on his rack without any back support".

The motion further states that Manning was only allowed 20 minutes of "sunshine call" a day. In addition, he was permitted by guards to take no more than five minutes in the shower. On the rare occasions that he was allowed out of his cell, Manning was forced to wear shackles with metal hand and leg restraints. At least two guards accompanied him at all times.

Manning was handed a pair of running shoes without laces for his trips outside, but they would fall off when he attempted to walk. As a result he "elected to wear boots instead", the document alleges.

The conditions were imposed, the US military has claimed, for Manning's own protection under a so-called "prevention of injury" order, or POI. But Manning's lawyer says there is clear evidence showing that the conditions were not imposed because of a risk of self-harm, and were instead used as a form of punishment. "The Brig's arbitrary policy to keep Manning subject to the harshest conditions possible shows an intent to punish Manning," the document says.

Coombs cites an incident in which Manning was forced to strip for an inspection after he remonstrated over his treatment at the detention centre. "It is well established that forced nudity is a classic humiliation technique. The only permissible inference is that the Brig intended to punish Manning by subjecting him to humiliating treatment because Manning correctly pointed out the absurdity of his POI status," it is claimed.

Manning was eventually transferred from Quantico before his pre-trial hearings. His time at Quantico was later condemned by Juan Mendez, the UN's special rapporteur on torture. A 14-month investigation by Mendez concluded that Manning had been subjected to cruel and inhuman conditions.

The defence motion is brought under Article 13 of the Uniform Code of Military Justice. It states that "no person, while being held for trial, may be subjected to punishment or penalty other than arrest or confinement upon the charges pending against him, nor shall the arrest or confinement imposed upon him be any more rigorous than the circumstances required to insure his presence."

Under Article 13, if a judge decides that a member of the armed forces has been illegally punished before trial, he can grant the prisoner credit on the amount of time they have already served in custody, or can even dismiss all charges outright.