Pfc. Bradley Manning, in a military courtroom Tuesday, faced for the first time the man he apparently thought was a kindred spirit but who instead told authorities that the soldier had carried off one of the largest intelligence leaks in U.S. history.

Manning, who has been detained for 19 months, stared intently at Adrian Lamo, a convicted hacker who alerted investigators about Manning in May 2010 shortly after the intelligence analyst reached out to Lamo over the Internet seeking “moral and emotional support.”

It was the most dramatic scene of the day as the prosecution rested its case in the hearing at Fort Meade to decide whether the government has sufficient evidence to send Manning to trial. The case has drawn global attention, featuring as its suspect a slight young man who has been held up variously as a whistleblowing hero and a traitor to his country.

Over four days of testimony from 20 witnesses in the digital age’s first major leak case, Army prosecutors outlined in painstaking detail how Manning, from a military base in Baghdad, allegedly downloaded onto his work and personal computers hundreds of thousands of documents and two videos from the military’s classified network.

But no witness presented direct evidence that showed harm to national security. Prosecutors did enter as evidence certain documents, including an al-Qaeda video and a magazine of al-Qaeda in the Arabian Peninsula, though they did not explain their relevance to the case.

Lamo, dressed in a dark suit and white open-necked shirt, dark circles under his eyes, strode to the witness box past Manning, 24, who wore fatigues and black-rimmed glasses. The two exchanged no words.

In a pointed cross-examination, Manning’s civilian defense attorney, David E. Coombs, attempted to portray Lamo as a double-dealing government informant who betrayed the trust of a troubled soldier who had contacted him over the Internet for moral support.

He directed Lamo to read from a lengthy transcript of Internet chats taken from his and Manning’s computers. The chats took place between May 20 and 26, 2010.

“I’m a journalist and a minister,” Lamo read, speaking in a monotone. “You can pick either, and treat this as a confession or an interview (never to be published) and enjoy a modicum of legal protection.”

Coombs, fixing Lamo with a steely glare, said: “Now at the time you were saying, ‘None of this is for print,’ you had already reached out to law enforcement. And you subsequently provided the chat logs not only to law enforcement but also to Wired magazine.”

Lamo replied: “That is correct.”

Coombs asked Lamo, who said he was a minister in the Universal Life Church, whether he believed “the person you were talking to was coming to you for moral and emotional support . . . asking for guidance.”

He replied: “I don’t believe they were looking for guidance so much as they were bragging about what they had done.”

Lamo, who pleaded guilty in 2004 to hacking into the computers of media companies, testified that on the second day of the chats, he attempted to alert law enforcement officials to Manning’s disclosures. “What I saw in the chats appeared to be an admission so egregious that they required a response,” he said.

Manning’s defense has focused on crafting a narrative of a distraught soldier whose superiors ignored repeated warnings that he was unfit for Army life, much less a position handling classified information.

“The government has told you a lot of stuff about how things happened,” Coombs said. “We’re telling you why things happened. That’s also important.”

Not long after Lamo went to authorities, Manning was detained. He faces 22 charges, ranging from “aiding the enemy” to adding unauthorized software to a classified computer.

The evidence produced over the past several days is damaging, experts said. It includes the existence of chat logs between Manning and WikiLeaks founder Julian Assange, who himself is under federal investigation for his role in publishing the leaked material. On Tuesday, witnesses offered more evidence: Even as Manning was facing discharge from the Army in May 2010 for “adjustment disorder” linked to issues with gender identity, he was apparently seeking to download for WikiLeaks a “global address list” of e-mail addresses for U.S. troops in Iraq.

But the government may have overreached in bringing some of the more serious charges, such as aiding the enemy, which carries a potential life sentence, military law experts said. Prosecutors need to show that Manning intended to give intelligence to the enemy, which is difficult to prove, said Eugene Fidell, who teaches military justice at Yale Law School. Calling WikiLeaks the enemy, said Fidell, is “a reach.”

The defense will present its witnesses Wednesday.

Staff researcher Julie Tate contributed to this report.