FORT MEADE, Md. — In a half-empty courtroom here, with a crew of fervent supporters in attendance, Pfc. Bradley Manning and his lawyer have spent the last two weeks turning the tables on the government.

Private Manning faces a potential life sentence if convicted on charges that he gave WikiLeaks, the antisecrecy organization, hundreds of thousands of confidential military and diplomatic documents. But for now, he has been effectively putting on trial his former jailers at the Quantico, Va., Marine Corps base. His lawyer, David E. Coombs, has grilled one Quantico official after another, demanding to know why his client was kept in isolation and stripped of his clothing at night as part of suicide-prevention measures.

Mr. Coombs, a polite but relentless interrogator who stands a foot taller than his client, has laid bare deep disagreements inside the military: psychiatrists thought the special measures unnecessary, while jail commanders ignored their advice and kept the suicide restrictions in place. In a long day of testimony last week, Private Manning of the Army, vilified as a dangerous traitor by some members of Congress but lauded as a war-crimes whistle-blower on the political left, heartened his sympathizers with an eloquent and even humorous performance on the stand.

“He was engaged, chipper, optimistic,” said Bill Wagner, 74, a retired NASA solar physicist who is a courtroom regular, dressed in the black “Truth” T-shirt favored by Private Manning’s supporters.