Image caption If Bradley Manning receives a prison sentence, it will be reduced by 112 days because of harsh treatment

The US soldier who disclosed hundreds of thousands of secret documents to Wikileaks betrayed his country to win fame, a prosecutor has said.

Pte First Class Bradley Manning, 25, knew al-Qaeda militants would see the material, a prosecutor said in closing arguments at the court martial.

Pte Manning has already pleaded guilty to 10 of the more than 20 counts he faces, and could face life in prison.

The case is considered the largest-ever leak of secret US government documents.

Last week a military judge refused to dismiss the most serious charge against Pte Manning, aiding the enemy, which carries a life sentence.

'Flag meant nothing'

Analysts say the verdict, to be decided by the judge alone, could have a big impact on future leakers.

The defence will deliver its closing statement on Friday.

On Thursday, prosecutor Maj Ashden Fein dismissed the defence's portrayal of Pte Manning as a confused and disillusioned young man, saying that the leak was an abuse of trust while he worked as an intelligence analyst for the Army in Iraq.

At the scene Sitting in the courtroom wearing full military uniform, Pte Bradley Manning occasionally wrote notes as he listened. Prosecutors have painted a picture of him as a soldier who leaked thousands of documents for one main reason: to gain a "lifetime of notoriety". There's no doubt Pte Manning's actions attracted worldwide attention, but he denies he was driven by a desire for fame. Prosecutors describe Pte Manning as self-interested and calculated, and say he wasn't a troubled and naive soldier, as the defence have said. As an intelligence officer in Iraq, he was given training on how to handle classified information, using sophisticated software. By going into minute details of when, where and how Pte Manning breached computer networks and conducted webchats with Wikileaks founder Julian Assange, the prosecution argue he was well aware that any leak of information could fall into the hands of America's enemies.

"The flag meant nothing to him," Maj Fein said.

He said that when US Navy Seals raided Osama Bin Laden's compound in Pakistan, they discovered among his belongings digital copies of documents leaked by Pte Manning.

Maj Fein also quoted chat logs between Pte Manning and hacker Adrian Lamo, who eventually turned the soldier in.

"Hillary Clinton, and several thousand diplomats around the world are going to have a heart attack," Pte Manning wrote to Lamo, said the prosecutor.

Fein, who described Wikileaks as "a bunch of anti-government activists and anarchists", argued that Pte Manning had "pulled as much information as possible to please Julian Assange".

Some two dozen supporters of Pte Manning protested outside the army base in the hours before the court opened.

Pte Manning has not denied his role in the leak, but in February said at a pre-trial hearing he had disclosed the documents to spark a public debate about US military and foreign policy.

His defence lawyer, David Coombs, argued earlier in the trial that there was no proof Pte Manning had aided the enemy.

Media playback is unsupported on your device Media caption The BBC's Ben Wright explains the case against Bradley Manning in 80 seconds

Mr Coombs acknowledged the soldier was guilty of negligence, but said he acted without the "general evil intent" required to justify the charge of aiding the enemy.

Military prosecutors maintain the leaks damaged national security and endangered American lives and those of foreign intelligence and diplomatic sources.

Among the items sent to Wikileaks was graphic footage of an Apache helicopter attack in 2007 that killed a dozen people in the Iraqi capital Baghdad, including a Reuters photographer.

Pte Manning was arrested in May 2010 while serving in Iraq. He spent weeks in a cell at Camp Arifjan, a US Army installation in Kuwait.

Whatever prison sentence Pte Manning receives will be reduced by 112 days, after a judge ruled he had suffered unduly harsh treatment during his initial detention following his arrest.