A villainous traitor to the US government and a heroic whistleblower to his legion supporters, Private Bradley Manning finally goes on trial behind the gates of Army Base Fort Meade in Maryland on Monday for spilling national secrets to WikiLeaks and allegedly aiding the enemy in a case that could lead to life imprisonment.

Three years almost to the day since his capture by US Army investigators, the 5ft 2in Manning who wears wire-rimmed glasses and looks younger than his 25 years, will listen as military prosecutors begin laying out their case arguing that by uploading material to WikiLeaks, including hundreds of thousands of documents and some video, he aided the enemy, put friends of the US at risk and embarrassed overseas diplomatic allies.

Much of the non-jury court martial which will be presided over by Colonel Denise Lind will be held behind closed doors with no press, public or outside stenographers present on the grounds that testimony from some witnesses may contain classified information. Barring a last-minute plea deal, the trial is set to last until the end of August when Manning, the son of a divorced American father and Welsh mother, will learn his fate.

Download the new Independent Premium app Sharing the full story, not just the headlines

Roughly 1,000 sympathisers and civil rights activists converged near the entrance of Fort Meade on Saturday to voice their opposition to the proceedings. They brandished banners with messages such as “Free Bradley” and “Bradley Manning: Jailed for exposing war crimes”. Among them was Daniel Ellsberg, a former defence department civil servant who leaked the Pentagon Papers during the Vietnam War.

The prosecution will assert that Manning must pay for exploiting his access to sensitive materials – none of which were classified top secret – while working as an intelligence officer near Baghdad, setting in train the biggest leak of US secrets in history. “Manning was a US analyst who we trained and trusted to use multiple intelligence systems … and he used that training to defy our trust,” Major Ashden Fein, a prosecutor, said in one pre-trial hearing.

In all, Manning faces 22 charges, the most serious of which include violating the 1917-era US Espionage Act and aiding the enemy. If he is found guilty of the most serious charges he may never regain his liberty. In February he admitted leaking the classified materials and offered to plead guilty to 10 lesser charges, which on their own mean he could spend 20 years behind bars.

Prosecutors, who will seek to demonstrate above all that Manning knew that by transferring the materials to WikiLeaks – including video footage of civilians being mistakenly killed during an Apache helicopter attack – he would cause harm to the US. Among the 150 or so witnesses due to testify against Manning are members of the US Navy Seal team that carried out the lethal raid against Osama bin Laden.They will say that information given to WikiLeaks was found among materials in the Pakistan hideout.

In a long statement, read out in the February pre-trial hearing, Manning indicated that he acted out of frustration with what he saw as the pointlessness of the twin wars in Iraq and Afghanistan. “I began to become depressed with the situation that we found ourselves increasingly mired in year after year,” he said.

“I felt that we were risking so much for people that seemed unwilling to cooperate with us, leading to frustration and anger on both sides.” He added his intention was to “spark a domestic debate over the role of the military and our foreign policy in general”.

A sometimes vengeful-seeming US government is also under pressure to answer some difficult questions, including on the highly restrictive and opaque nature of the proceedings against Manning. Only a small pool of reporters will be allowed in the sparse Fort Meade courtroom. Judge Lind has declined to release transcripts even of her own, highly consequential rulings. The decision announced last week to hold some of the trial behind closed doors was also hers.

Daily coronavirus briefing No hype, just the advice and analysis you need Enter your email address Continue Continue Please enter an email address Email address is invalid Fill out this field Email address is invalid Email already exists. Log in to update your newsletter preferences Register with your social account or click here to log in I would like to receive morning headlines Monday - Friday plus breaking news alerts by email Update newsletter preferences

“Americans who care about the future of our country need to be involved in Bradley’s defence,” Mr Ellsberg said in a statement. “The defining issues of the 21st century, including the transparency and accountability of our government are at stake. I believe history is on the side of those who seek to reveal the truth, not on the side of those who seek to conceal it.”

Civil rights organisations and even a special UN rapporteur chastised the US for the conditions that Manning was originally held in at the Quantico Marine base in Virginia, which they contended was tantamount to torture.

The spokesman of the US State Department at the time, P J Crowley, called it “counterproductive and stupid”. Judge Lind has acknowledged the conditions were egregious and has given Manning a 12-day credit against any sentence. Manning was later moved from Quantico to a secure military jail in Leavenworth, Kansas.

Others meanwhile have asked whether the US itself and the Army should bear partial responsibility for the leaks because nothing was in place to stop a junior, enlisted soldier accessing such a trove of secrets and mining it. “The lack of any efficient control over the content of the material was a huge issue. He shouldn’t have been able to do what he did. It’s disturbing and embarrassing,” noted Donald Guter, president of the South Texas College of Law.

The trial begins as the US government is coming under increased scrutiny for the ferocity of its war against national security leaks to the media. The administration of Barack Obama has sought to prosecute leakers, including Manning, like none other before it. It recently came to light that in just one leak inquiry, the Justice Department seized the telephone and email records of 20 Associated Press reporters and editors without informing them.

Not able to attend the trial or the protests, of course, is Julian Assange, the WikiLeaks founder who has been hiding from arrest in the Ecuadorean embassy in London for months.

Timeline: from Iraq to military trial

October 2009: Bradley Manning is posted to Iraq as an intelligence officer.

November 2009: Manning contacts WikiLeaks founder Julian Assange for the first time.

February – April 2010: Manning allegedly sends damaging footage of a US air strike to WikiLeaks, which publishes it as “Collateral Murder” on 5 April. The video proves highly damaging to the US.

May 2010: Manning is arrested and placed in pre-trial confinement at Camp Arifjan in Kuwait

July 2010: Manning is charged with leaking the video and secret diplomatic cables to WikiLeaks.

March 2011: Twenty-two new charges are brought against him, including “aiding the enemy” (punishable by death).

April 2011: Manning is moved to a Kansas jail after international criticism over his treatment in Virginia.

January 2012: A US investigating officer recommends that Manning faces a military trial.

November 2012: Manning testifies at a hearing in Fort Meade about his treatment in prison following his arrest in Baghdad, including 23 hours a day in a windowless cell.

February 2013: Manning pleads guilty to 10 of the 22 charges against him but denies the most serious charge of aiding the enemy.