Sketched ... U.S. Army Private Bradley Manning as seen in a courthouse at Fort Meade, Maryland. Some of what caused misery in Private Manning's life - his broken family and chronic loneliness, his homosexuality and gender uncertainty - has been reported since his arrest at the isolated FOB (Forward Operating Base) Hammer, near Baghdad, in May 2010. More sensational then, was the revelation at his pre-trial hearing at the Fort Meade military complex in Maryland of just how much of it, and his inability to cope, was known to the military - and virtually ignored. As a schoolboy in the US and in Wales, Manning would be seized by fits of rage and would slam books on desks if he was misunderstood or if he was teased as a geek or a gay. As a teenager, he was treated for depression; he pulled a knife on his stepmother; and one of his first intimate relationships was with a self-described drag queen. Within a month of signing up with the US Army in October 2007, he was deemed a ''liability'' by superiors and assigned to a ''discharge unit'' - one step short of being thrown out. Before deploying to Iraq he punched a female officer in the face and was sent to counselling for blabbing about his intelligence work and training in a YouTube video.

He was assessed psychiatrically several times but he was allowed to remain in the service, apparently because of his computer skills. ''That mess of a child,'' was how an army officer involved in the case described Manning to The Guardian, before adding: ''No one has mentioned the army's failure here.'' Shortly after arriving at FOB Hammer, the bolt was removed from Private Manning's weapon on the grounds that he was a risk to himself and to others. His superiors complained of his ''dissociative behaviour'' - body in one place, mind in another - while he sought online counselling on a gender transition. While being counselled in Baghdad for bad behaviour he flipped a table and was restrained as he ''went for a weapons rack''. Private Manning had emailed one of his superiors, complaining of his ''gender identity disorder'' - and attaching a photograph of himself dressed as a woman. But the recipient did not act on the email until after Private Manning's arrest. Similarly, explicit warnings that his uncontrolled outbursts and ''elevated levels of paranoia'' warranted the withdrawal of his security clearance were ignored. Private Manning was so insecure that when picked on by army colleagues he would wet his pants and in the weeks before his arrest he stabbed a chair with a knife and later was found hiding in a storeroom, in the foetal position. Only then was he booked and informed that he was to be discharged - on the grounds that he had an ''adjustment disorder''.

How could security at FOB Hammer be so lax that Manning and his colleagues could leave secret military passwords near their computers, in what was described as a ''security free-for-all''? How was it that his months of rummaging through the global archives, and his copying of a quarter of a million documents that had nothing to do with his work in Iraq went undetected? Arguing that ''the whole need to know'' principle had been compromised by demands for greater intelligence sharing between US agencies following the September 11 attacks on the US, the former CIA analyst Raymond McGovern likened the Manning case to that of Abu Ghraib, in which only junior service members were held to account for the torture of Iraqi prisoners. ''In today's army people are told they can do things - if they get caught, the officers will be defended; if they are from the bottom of the barrel they get told they are rotten apples,'' he said. Ann Wright, a former army colonel and a member of the foreign service, sees the Manning case as further proof of ''the whole system breaking down''. ''As a senior foreign service officer and acting or deputy ambassador in four different posts, I never had access to the unpardonable amount of data that that kid had in his wooden shack in nowhere in Iraq - the system has failed miserably.''

After a week-long pre-trial hearing, the army investigating officer, Lieutenant-Colonel Paul Almanza, late last week recommended Private Manning face a court martial on all 23 charges.