FORT MEADE, Md.— U.S. Army Pfc. Bradley Manning was acquitted of aiding the enemy — the most serious charge he faced — but was convicted of espionage, theft and other charges Tuesday, more than three years after he spilled secrets to WikiLeaks.

The judge, Army Col. Denise Lind, deliberated for about 16 hours over three days before reaching her decision in a case that drew worldwide attention as supporters hailed Manning as a whistleblower. The U.S. government called him an anarchist computer hacker and attention-seeking traitor.

Manning stood at attention as the judge read her verdicts. He appeared not to react, though his attorney, David Coombs, smiled faintly when he heard not guilty on aiding the enemy, which carried a potential life sentence.

Manning was convicted on 20 of 22 charges, including a guilty plea the government accepted in February. He faces up to 136 years in prison. His sentencing hearing begins Wednesday.

“We won the battle, now we need to go win the war,” Coombs said of the sentencing phase. “Today is a good day, but Bradley is by no means out of the fire.”

Manning’s court-martial was unusual because he acknowledged giving the anti-secrecy website more than 700,000 battlefield reports and diplomatic cables, and video of a 2007 U.S. helicopter attack that killed civilians in Iraq, including a Reuters news photographer and his driver.

In the footage, airmen laughed and called targets “dead bastards.” A military investigation found troops mistook the camera equipment for weapons.

Besides the aiding the enemy acquittal, Manning was also found not guilty of an espionage charge when the judge found prosecutors had not proved their assertion Manning started giving material to WikiLeaks in late 2009. Manning said he started the leaks in February the following year.

Manning pleaded guilty earlier this year to lesser offenses that could have brought him 20 years behind bars.

Manning said during a pre-trial hearing in February he leaked the material to expose the U.S military’s “bloodlust” and what he considered American diplomatic deceit. He said he chose information he believed would not harm the U.S. and he wanted to start a debate on military and foreign policy. He did not testify at his court-martial.

Coombs portrayed Manning as a “young, naive but good-intentioned” soldier who was in emotional turmoil, partly because he was a gay service member at a time when homosexuals were barred from serving openly in the U.S. military.

He said Manning could have sold the information, but he gave it to WikiLeaks in an attempt to “spark reform”. Counterintelligence witnesses valued the Iraq and Afghanistan war logs at about $5.7 million.

Coombs said Manning had no way of knowing whether al-Qaida would access the website and a 2008 counterintelligence report showed the government itself didn’t know much about the site.

The lead prosecutor, Maj. Ashden Fein, said Manning knew the material would be seen by al-Qaida. Even Osama bin Laden had some of the digital files at his compound when he was killed.

The material WikiLeaks began publishing in 2010 documented complaints of abuses against Iraqi detainees, a U.S. tally of civilian deaths in Iraq, and America’s weak support for the government of Tunisia.

The Obama administration said the release threatened to expose valuable military and diplomatic sources and strained America’s relations with other governments.