Bradley Manning, the suspected source of the largest leak of classified U.S. documents in history, spent his 24th birthday in military court on Saturday listening to investigators detail how they pieced together the case against him.

Manning was a U.S. Army intelligence analyst in Iraq when he is alleged to have illegally downloaded massive data files from the military's classified network and became a source for anti-secrecy website WikiLeaks.

U.S. officials say WikiLeak's successive data dumps last year, including sensitive diplomatic cables, endangered national security and Manning faces charges including aiding the enemy which could send him to prison for life.

Manning, wearing military fatigues and dark-rimmed glasses, was led into courtroom at Fort Meade, Maryland, uncuffed on the second-day of pre-trial hearings. He listened intently as prosecutors attempted to show they had enough evidence to go to trial under a general court marshall.

That evidence included chat logs in which Manning appears to disclose his activities to former hacker Adrian Lamo, who turned the intelligence analyst in to authorities, triggering the U.S. military investigation in May, 2010.

In Internet chats with Lamo, Manning said he would bring in CDs and load them with downloaded data from the military's Secret Internet Protocol Router Network, known as SIPRNet, Lamo told Reuters in a previous interview.

The prosecution is seeking a general court martial on 22 criminal charges.

If convicted of all counts, Manning would face a maximum punishment of life imprisonment, reduction in rank to the lowest enlisted pay grade, forfeiture of all pay and allowances and a dishonorable discharge, the Army says.

Searches of Manning's belongings turned up multiple instances in which classified information was improperly transferred to portable storage devices, including an SD memory card found through a search of Manning's belongings in the basement of his aunt's home in Potomac, Maryland.

One of the items found among his belongings was a copy of a gunsight video that showed a 2007 helicopter attack that killed a dozen people in Iraq, including two Reuters journalists. The video was released publicly by WikiLeaks last year.

The prosecution did not present that video as evidence but one witness directly blamed Manning for its broad release.

MENTAL, EMOTIONAL ISSUES

Now over 5 million people have viewed it and the 5 million -- or 5 billion, whatever the number is -- they're all unauthorized individuals, Special Agent Toni Graham, with the Army Criminal Investigation Division of the Military Police, said, testifying remotely by telephone.

Manning's defense attorneys since the start of proceedings have raised questions about the classification of evidence Manning is alleged to have leaked. On Saturday, they asked about the gunsight video.

They also drew attention to concerns about Manning's mental state, including his struggle with homosexuality. At the time the files were leaked, being openly gay was prohibited in the U.S. military, a ban it ended earlier this year.

Graham confirmed she had found a folder with printed materials related to gender identity, but disregarded them as irrelevant to the investigation.

We already knew that Pfc Manning was a homosexual. ... We knew he was interested in those topics, she said, adding that he had a very limited number of friends.

Manning was quiet during Saturday's proceedings, occasionally taking notes or twirling a pen in his hands. He sometimes turned to speak softly to his attorneys but did not address the court.

In his Web chats with Lamo, Manning appeared to acknowledge giving materials to WikiLeaks founder Julian Assange.

He wrote to Lamo: I'm a high profile source ... and I've developed a relationship with Assange, according to details of the chats confirmed by Lamo to Reuters.

The Justice Department is investigating Assange and one of his attorneys, Jennifer Robinson, was in the courtroom Saturday.

Assange is in Britain fighting extradition to Sweden over accusations of rape and sexual assault made by two female former WikiLeaks volunteers in August 2010. Britain's Supreme Court said on Friday it had granted permission for Assange to appeal his case.

(Writing by Phil Stewart)