FORT MEADE, Md. - A military judge refused Tuesday to dismiss the charges against the Army private accused of treason for providing reams of government secrets to WikiLeaks, saying numerous pretrial delays were necessary because of the "voluminous amount of classified information."

The ruling now clears the way for Pfc. Bradley Manning to appear in a military courtroom here Thursday and probably plead guilty to some of the lesser charges against him, including the unauthorized release of classified information, in return for about 20 years in prison.

But it would leave intact the most serious charge - treason - and other allegations that, if he is convicted after his trial begins in June, could mean the 25-year-old Iraq war veteran will spend the rest of his life in military prison. Manning was taken into custody in May 2010, and by Tuesday had spent 1,005 days in jail.

His lead attorney, David Coombs, asked for the dismissal because he said the government delays were "nothing short of shameful," noting that it took nearly 18 months just to get government agencies to review classified data.

"These classification reviews were not Tolstoy novels - they were generally documents that spanned three or four pages," Coombs said in a defense brief.

The prosecution, however, said it has taken an extraordinary amount of time to track about 250,000 State Department cables, U.S. military field reports from Iraq and Afghanistan, video of an American helicopter mistakenly shooting two Reuters reporters, and assessments of terrorism detainees at the U.S. naval base at Guantanamo Bay, Cuba.

The judge, Army Col. Denise Lind, ruled that because of "the nature of the case, … the delays were not for any unreasonable amount of time."

She also noted that mental stability assessments had to be conducted on Manning, including a period in which he was under suicide watch, and that tens of thousands of State Department and FBI records had to be reviewed.

Further, she said, when Manning was arrested in Iraq, "the investigation was then in its infancy. The government was not aware of the breadth and scope of the conduct when the accused was first charged."

The leaks to Julian Assange, the man behind WikiLeaks, disclosed how the U.S. government waged two wars, handled prisoners of war and dealt behind the scenes with other governments.