JEFFREY BROWN: Finally tonight, shedding new light on WikiLeaks.
This evening on "Frontline," correspondent Martin Smith unravels the mystery of Bradley Manning, the Army private who allegedly stole thousands of classified government documents.
One part of the tale has been largely unknown, the story of the hacker who blew the whistle on Manning.
Here's how it unfolds from tonight's program titled "Wiki Secrets."
MARTIN SMITH: In late May, a hacker in California was contacted and began a chat with someone using the screen name Bradass87.
"If you had free rein over classified networks, and you saw incredible things, awful things, what would you do?"
ADRIAN LAMO, former hacker: He spoke in hypotheticals at first. Even then, I largely blew it off. There just aren't enough hours in the day to correspond with everybody that wants to correspond with me.
MARTIN SMITH: The hacker, Adrian Lamo, was well-known in the cyber-underground. In 2003, he had been arrested for hacking The New York Times. And the day before the chat, Lamo was featured in an article on Wired.com that discussed his psychiatric problems.
Bradass87 would keep up his chat with Lamo for the next four days.
ADRIAN LAMO: He talked a lot about his personal life, about his relationships, about his experiences in the military, about experiences back home.
MARTIN SMITH: Lamo says the person also contacted him via e-mail, and they became friends on Facebook. It was Bradley Manning, intelligence analyst in Iraq. And, in his profile, there was the chat name, Bradass87. He read more.
ADRIAN LAMO: Looking at his Facebook page, I got the sense that Bradley was very depressed.
MARTIN SMITH: Then, during one their chats, Bradass87 started dropping hints about a crazy white-haired Aussie.
ADRIAN LAMO: He mentioned Julian Assange in the context Julian was the individual at WikiLeaks who he had initially established contact with.
MARTIN SMITH: He also mentioned that he had leaked thousands of classified documents, including a huge tranche of diplomatic cables.
ADRIAN LAMO: I asked him if there was any way to recover the documents. He indicated that they had already been uploaded to WikiLeaks' server. It was a fairly unambiguous statement.
MARTIN SMITH: Lamo says he believed Manning was a security risk and worried that if he didn't say something he could be party to a crime. He called an old friend, Tim Webster.
TIM WEBSTER, former Army counterintelligence agent: Adrian was quite conflicted. We had a back-and-forth where he was concerned about whether or not this was the right thing to do, whether to betray this person's trust was appropriate, given his actions.
Adrian recognized that we can't have somebody out there leaking classified information like this. It's not something he could allow to continue.
MARTIN SMITH: Webster coached Lamo to keep up the chat as long as possible, to find out more details. He also alerted the Pentagon that they may have a security breach. Lamo was nervous and felt trapped.
ADRIAN LAMO: There was no correct option. There was only the least incorrect one. Either way, I would have been screwing somebody over. I had to pick who. There was no option to just sit back and to wash my hands of the responsibility, because that, in and of itself, would have been making a choice.
MARTIN SMITH: Lamo then called a reporter he knew at Wired.com.
KEVIN POULSEN, Wired.com: He called me to tell me that he had a meeting set up the next day with the FBI and the Army because he was turning in somebody who had contacted him online and confessed to -- to passing classified information to -- to someone he described as a foreign national.
MARTIN SMITH: Poulsen convinced Lamo to hand him a copy of the chat, and then asked a colleague to follow up on any leads.
KIM ZETTER, Wired.com: We went through the chat logs and we looked at what else he mentioned. Tyler Watkins was named in the chat logs.
MARTIN SMITH: Zetter called Watkins. He told her about a conversation he had had with Manning during Manning's January visit to Boston.
KIM ZETTER: Brad had told him that he had uncovered information that was concerned him and he was considering leaking it. And so, he was weighing that, whether or not the good that he felt he would be doing in leaking the information outweighed any kind of, you know, personal suffering that he might undergo for leaking it.
MARTIN SMITH: On May 26, 2010, Bradley Manning was arrested. It was posted on Facebook.
KEVIN POULSEN: We got confirmation that Manning had been arrested when Manning called his aunt from jail.
KIM ZETTER: And asked her to update his Facebook page with a message.
MARTIN SMITH: It would be his final Facebook entry.
JEFFREY BROWN: "Frontline" airs on most PBS stations tonight. And you can find a conversation with Martin Smith on the Rundown blog on our website.