FORT MEADE, Md. - A key prosecution witness told a military judge Tuesday that an emotionally distraught Army Pfc. Bradley Manning confessed to him in encrypted Internet chats to pilfering a vast trove of U.S. military and diplomatic secrets and passing them to the WikiLeaks website.

The witness, Adrian Lamo, said he was so alarmed by his online conversations with Bradass87, Manning's Internet moniker, over five days in May 2010 that he felt compelled to alert law enforcement, prompting Manning's arrest several days later.

"This person was admitting to acts so egregious that it required that response," said Lamo, who confessed in 2004 to illegal computer hacking and was sentenced to 2 1/2 years' probation.

The digital record of those online chats is crucial to the prosecution's case that Manning, an Army intelligence analyst, illegally downloaded more than half a million classified files and other material from a military computer network in a massive breach of national security.

Lamo testified for 75 minutes on the fifth day of a military court hearing to determine if Manning should face a full court-martial. Prosecutors rested their case after Lamo stepped down.

Defense attorneys will start calling witnesses Wednesday. Manning faces 22 criminal charges, including aiding the enemy and violating the Espionage Act. If convicted, he could be sentenced to life in prison. He has pleaded not guilty.

The case against Manning hangs, in large part, on digital files, e-mails, and chats that prosecutors say they recovered from his personal computer and other devices after he was arrested May 29, 2010, at an Army base in Iraq. But Lamo's testimony was perhaps the most damaging evidence to emerge so far.

Lamo said he met Manning in the digital world after the intelligence analyst sent him an e-mail introducing himself. Lamo suggested they chat over AOL Instant Messenger using encryption software called OTR to communicate, he said, and they were in contact from May 21 to May 26, 2010.

Lamo later became an unpaid confidential informant for Army criminal investigators.