The former commander of Quantico marine base in Virginia has revealed to the court martial of Bradley Manning that he warned his Pentagon superiors that the jail on the base was insufficiently prepared to deal with the long-term detention of the WikiLeaks suspect.

Daniel Choike told a pre-trial hearing in Fort Meade, Maryland, that when Manning arrived at the brig on 29 July 2010, having been arrested in Iraq on suspicion of being the source of the massive WikiLeaks dump of state secrets, he informed his superior officer in the Pentagon that in his opinion Quantico was not the right place for the soldier should his detention last long.

"I didn't feel that PFC Manning should be detained more than 90 days in the brig," he said.

In the end, Manning spent nine months at Quantico – three times the maximum Choike thought appropriate. The soldier's treatment there prompted international protests from the UN, Amnesty International and other organisations that likened it to torture.

Choike's admission that he had been aware of problems relating to Manning's incarceration at the Quantico brig came on Tuesday, at the end of an intense first day in the latest pre-trial hearing in the soldier's court martial. The army private, who worked as an intelligence analyst in a military base outside Baghdad from 2009 until his arrest in May 2010, faces 22 counts relating to the transfer of hundreds of thousands of confidential US documents to the whistleblowing website.

After about seven hours of questioning, Choike told the judge presiding over the court martial, Colonel Denise Lind, that he had been concerned from the beginning that the brig at Quantico was unprepared for the long-term detention of such a high-profile case as Manning. He said he was worried about dealing with the media, about co-ordination of command and about medical handling of the detainee.

He added that he "constantly" told his superior, Lieutenant General George Flynn, based in the Pentagon, that there were problems with the soldier's prolonged detention in Quantico.

On Wednesday morning the court learnt that concern about the way Manning was being treated within the Quantico brig reached high levels within the military. An email was read out from Lieutenant Colonel Wright, the most senior expert on corrections issues within the Marines.

He wrote to the commander of the brig to express his "concerns about recent decisions", in particular the removal on 2 March 2011 of Manning's underpants at night. Wright pointed out that the move was a contradiction – it treated Manning as if he were a suicide risk, and yet he had not actually been placed under a suicide risk order. "This is not the way we do business," Wright wrote.

Despite his reprimand, the chief warrant officer at the brig, Denise Barnes, continued to remove the soldier's underwear every night for the next six weeks, until his transfer to a lesser-security regime at Fort Leavenworth on 20 April 2011.

The morning was taken up with defence questioning of Robert Oltman, Quantico's security battalion commander in charge of the brig. Like Choike's earlier testimony, Oltman expressed his disatisfaction that Manning had been placed in Quantico in the first place, given the parlous state of its brig.

"We indicated we didn't think our facility was the best for his detainment. It was supposed to be closed, it was not in the best of conditions, it needed repair," he said.

The testimony throws into a new light the events at Quantico during Manning's nine-month incarceration. His treatment under a so-called "prevention of injury" order, or PoI, has become a cause célèbre for his supporters, who believe that the soldier was subjected to unlawful pre-trial punishment in an attempt to squeeze him for information that might prove useful in any ensuing prosecution of WikiLeaks and its founder, Julian Assange.

This week's hearing is attracting considerable media attention, because it holds the promise that Manning might speak in public for the first time. He is listed on the defence roster of witnesses, though he has not yet been added to the official order of play for the hearing.

Should Manning be called, it is not likely to be on Wednesday. His defence lawyer, David Coombs, is expected to question first Marine Colonel Robert Altman, who was commander of the brig while the soldier was detained there. Then the defence will turn to three forensic psychiatrists who were responsible for Manning's medical care at Quantico: navy captains William Hoctor and Kevin Moore and army colonel Rick Malone.

The defence will be quizzing the doctors about the recommendations they made to the military hierarchy about the state of Manning's mental health. Court documents already released suggest that they advised on several occasions that the soldier was well enough to be taken off the PoI and returned to the general brig population, as he was no longer a suicide risk, yet the marine commanders ignored their specialist advice, in contravention of military rules.

Article 13 of the Uniform Code of Military Justice prohibits punishment before trial of any individual, on the same assumption as that in civilian law that a person is innocent until proven guilty. Should the judge be convinced by the defence argument that Manning was subjected to unlawful pre-trial punishment at Quantico, she has the power to reduce his sentence should he be found guilty, or even throw out all the charges.