The epic courtroom battle between the WikiLeaks suspect Bradley Manning and the US government over his alleged pre-trial punishment has drawn to a close, with the soldier's lawyer accusing the military of treating him like a zoo animal and the prosecution countering that in its view he was entitled to have just seven days removed from any eventual sentence.

The two-week hearing at Fort Meade, Maryland, lasted far longer than intended and turned into a dramatic spectacle in which Manning effectively turned his court-martial on its head and put the US military on trial. In his closing argument, the soldier's main civilian lawyer, David Coombs, said that the most amazing element of his nine-month solitary confinement under suicide-prevention restrictions at the marine brig in Quantico, Virginia, was that his spirit had remained unbroken.

"Being watched or viewed almost as a zoo animal for that period of time has to weigh on somebody's psyche," Coombs told the court.

Over 10 days of intense legal proceedings, lasting for up to eight hours every day, a clear picture emerged within the courtroom of how Manning, 24, had been trapped in a Kafkaesque paradox. Whatever he did – or didn't do – was taken by his military captors as proof of his suicidal tendencies.

The court heard from psychiatrists who had reported virtually every week that Manning was in good mental health and no risk to himself. Yet every week they were overruled by military officers at the brig.

Manning was made to strip naked at night and to stand to attention in the nude in front of his military superiors at morning call. For weeks he was held in his 8x6 ft cell for 23 hours and 40 minutes every day.

In his summing up, Coombs suggested that the military had been more concerned to protect itself from media criticism than it was about following its own guidelines and treating Manning properly. "They were more concerned with how it would look if something happened to Pfc Manning than they were about whether Pfc Manning was actually at risk. Their approach was: 'Let's not have anything happen on our watch. Let's not let anything happen that's going to make us look bad.'"

Coombs added that correct military procedures had suffered a "complete breakdown … All logic by anyone who could affect change for Pfc Manning was checked at the door."

Manning has been charged with "aiding the enemy" – in effect al-Qaida – by passing hundreds of thousands of confidential US documents to the whistleblowing website WikiLeaks. He has effectively admitted passing government information to the site but has not accepted that by doing so he acted as a traitor.

In its closing argument, the US government made some concession to the defence claim that he was subjected to overly rigorous suicide-prevention controls. It conceded that the inmate should have been taken off suicide watch – the most stringent regime possible – more swiftly, in line with the advice from brig psychiatrists.

But the prosecutors only accepted that Manning had been subjected to seven days of unwarranted suicide watch, and called the judge to award a 1:1 reduction in the soldier's eventual sentence. That would mean that Manning would be entitled to just seven days of credit in recognition of what he went through in Quantico, a reduction that would come off a maximum possible sentence of life in custody with no chance of parole.

The offer outraged Manning supporters. Nathan Fuller of the Bradley Manning support network, tweeted: "So the U.S. government argues that Bradley Manning should be sentenced to the rest of his life in prison...minus seven days."

Manning supporters were also outraged by a comment made in closing argument by Major Ashden Fein, the chief government prosecutor. "When brig officials saw someone who was not like others, they tried to figure it out to the best of their abilities on a daily basis."

In earlier testimony the court, the judge has heard that at the time he transferred government information to WikiLeaks Manning was struggling with deep emotional conflicts including his desire to have gender re-alignment.

The burden of proof lies with the US government to show that the maximum security status and suicide-prevention measures it imposed throughout the nine months in Quantico were justified. The unprecedented length of time Manning spent in solitary confinement supposedly because he was a risk to himself prompted the UN rapporteur on torture to denounce it as a form of torture.

The judge presiding over Manning's court-martial, Colonel Denise Lind, now has a mountain of transcripts and admitted evidence to wade through before she can issue her ruling on the defence motion. The earliest she is likely to do so would be in the next pre-trial hearing scheduled for 8 January.