FORT MEADE, Md. — A military judge on Tuesday found Pfc. Bradley Manning not guilty of “aiding the enemy” for his release of hundreds of thousands of military and diplomatic documents to WikiLeaks for publication on the Internet, rejecting the government’s unprecedented effort to bring such a charge in a leak case.

But the judge in the court-martial, Col. Denise R. Lind, convicted Private Manning of six counts of violating the Espionage Act of 1917 and most of the other crimes he was charged with. He faces a theoretical maximum sentence of 136 years in prison, although legal experts said the actual term was likely to be much shorter.

While advocates of open government celebrated his acquittal on the most serious charge, the case still appears destined to stand as a fierce warning to any government employee who is tempted to make public vast numbers of secret documents. Private Manning’s actions lifted a veil on American military and diplomatic activities around the world, and engendered a broad debate over what information should become public, how the government treats leakers, and what happens to those who see themselves as whistle-blowers.

“We always hate to see a government employee who was trying to publicize wrongdoing convicted of a crime, but this case was unusual from the start because of the scope of his release,” said Gregg Leslie of the Reporters Committee for Freedom of the Press, adding, “Whistle-blowers always know they are taking risks, and the more they reveal the bigger the threat is against them.”