Hackers often pride themselves on their anti-authoritarian and counter culture stance.

So news that former high-profile hacker Adrian Lamo had turned over an Army intelligence analyst to authorities was met with derision by some.

"A lot of people have labelled me a snitch," Mr Lamo told BBC News. "I guess I deserve that on this one but not as a generality."

"This was a very hard decision for me."

Mr Lamo is a former hacker, who exposed security flaws at the New York Times, Yahoo and Microsoft. After a brief stint hiding from the FBI, Mr Lamo was imprisoned and fined. He now works as a journalist and security analyst.

'By the book'

Mr Lamo says that he was responsible for reporting Specialist (SPC) Brad Manning to the military authorities after the analyst boasted to him that he had handed over thousands of classified documents and classified military video to whistle-blower site Wikileaks.

One video posted to the site shows a US Apache helicopter killing up to 12 people - including two Reuters journalists - during an attack in Baghdad in 2007. Two children were also seriously injured in the attack. Some of the men were armed.

Mr Manning, 22, reportedly acquired the video during the course of his work at a US Military field base FOB Hammer, on the outskirts of Baghdad.

I didn't want any more FBI agents knocking at the door Adrian Lamo US intelligence analyst arrested

Mr Lamo said that he did not suspect anything unusual when Mr Manning contacted him over instant messenger and e-mail.

"I'm contacted on a daily basis by all kinds of people who confess to all kinds of federal crimes," he said.

"I have never once turned them in, even when the FBI offered me a deal."

However, after Mr Manning confessed to distributing the documents, Mr Lamo said that his stance changed and he "felt the need to contact investigators".

"At the moment he gave me the information, it was basically a suicide pact."

"I was worried for my family - that if I were obstructing justice that they could be caught up in any investigation," he said.

"I wanted to do this one by the book, by the numbers. I didn't want any more FBI agents knocking at the door."

Code words

Mr Lamo also said that he had decided to report Mr Manning for reasons of national security.

Instead of going straight to the authorities, Mr Lamo disclosed the information to "a friend" who had worked as an agent in the Army counter intelligence unit.

"He put me in touch with some of his former colleagues who he felt could handle the issue in a low key way," he said.

Image caption WikiLeaks has established a reputation for publishing sensitive materials Who are WikiLeaks?

Four agents - from different federal and military agencies - turned up at his house to read the conversation logs - from his e-mail and instant messenger conversations with Mr Manning - "one by one", he added.

"I gave them conversation logs that implicated Special Agent Manning.

"They were particularly interested in a code word for a major operation."

Mr Lamo also described how Mr Manning had supposedly obtained the documents.

"He described the process of operational security in detail," said Mr Lamo.

"What he described was a culture of insecurity with poor attention to information.

"The field base didn't have significant security."

'Impossible decision'

He said that Mr Manning would download the documents from a room that needed a unique security code to access it. However, security on the base had slipped, he said.

"He said you'd knock on the door and they'd let you in."

Mr Lamo said that Mr Manning would take a CD labelled Lady Gaga into the room which he would load into a computer.

I want to be proud of it but I can't bring myself to be Adrian Lamo

"Basically he sat down and started burning data to the CD whilst pretending to be bopping along."

Mr Manning would then upload the documents to Wikileaks servers, which are held in various countries around the world and anonymise the source.

Wikileaks has not confirmed Mr Manning as the source of the video and has said it never collects personal information on sources. It said that it has not been sent 260,000 classified US embassy cables that Mr Manning reportedly leaked to the site.

Wikileaks also questions Mr Lamo's credibility.

However, the US military has confirmed that Mr Manning has been detained on suspicion of leaking classified documents and video. He is being held "in pre-trial confinement" in Kuwait.

"I want to be proud of it but I can't bring myself to be. I keep thinking about what it was like being 22, alone and not knowing about my future," said Mr Lamo.

"Knowing that I did that to somebody - it hurts. I feel like I should be talking to a priest."

He said he had been placed in a situation where "an impossible decision had to be made".

"I hope that Manning gets the same chance as I did - the same chance to take his punishment as I did and start a new life as I did."

"I like to think I prevented him from getting into more serious trouble."