FORT MEADE, Md. — A military judge on Tuesday reduced the potential sentence for an Army private accused of sending reams of classified documents to the WikiLeaks website.

Col. Denise Lind made the ruling during a pretrial hearing at Fort Meade for Pfc. Bradley Manning.

Lind found that Manning suffered illegal pretrial punishment during nine months in a Marine Corps brig in Quantico, Va. She awarded a total of 112 days off any prison sentence Manning gets if he is convicted.

Manning was confined to a windowless cell 23 hours a day, sometimes with no clothing. Brig officials say it was to keep him from hurting himself or others.

The judge said that Manning’s confinement was “more rigorous than necessary.” She added that the conditions “became excessive in relation to legitimate government interests.”

Manning faces 22 charges, including aiding the enemy, which carries a maximum of life behind bars. His trial begins March 6.

The 25-year-old intelligence analyst sought to have the charges against him thrown out, arguing that the military held him in unduly punishing pretrial conditions after his 2010 arrest.

Jailers at the Marine Corps brig in Quantico, Va., have testified they considered Manning a suicide risk and that they were only trying to keep him from hurting himself and others by keeping him in a windowless, 6-by-8-foot cell for all but one hour a day.

Prosecutors conceded in December that Manning was improperly held on suicide watch for seven days and recommended he get seven days’ credit at sentencing.

Manning is back at Fort Meade for a pretrial hearing that includes arguments on whether his motivation matters.

Prosecutors want the judge to bar the defense from producing evidence at Manning’s trial regarding his motive for allegedly leaking hundreds of thousands of secret war logs and diplomatic cables. They say motive is irrelevant to whether he leaked intelligence, knowing it would be seen by al-Qaida

Manning allegedly told an online confidant-turned-informant that he leaked the material because “I want people to see the truth” and “information should be free.”

Defense attorney David Coombs said Tuesday that barring such evidence would cripple the defense’s ability to argue that Manning leaked only information that he believed couldn’t hurt the United States or help a foreign nation.

Manning has offered to take responsibility for the leaks in a pending plea offer but he still could face trial on charges that include aiding the enemy.