The Anonymous hacktivist sentenced on Friday to 10 years in federal prison for his role in releasing thousands of emails from the private intelligence firm Stratfor has told a Manhattan court that he was directed by an FBI informant to break into the official websites of several governments around the world.

Jeremy Hammond, 28, told a federal court for the southern district of New York that a fellow hacker who went under the internet pseudonym “Sabu” had supplied him with lists of websites that were vulnerable to attack, including those of many foreign countries. The defendant mentioned specifically Brazil, Iran and Turkey before being stopped by judge Loretta Preska, who had ruled previously that the names of all the countries involved should be redacted to retain their secrecy.

Within a couple of hours of the hearing, the three countries had been identified publicly by Forbes, the Huffington Post and Twitter feeds serving more than a million followers. “I broke into numerous sites and handed over passwords and backdoors that enabled Sabu – and by extension his FBI handlers – to control these targets,” Hammond told the court.

The 28-year-old hacker has floated the theory in the past that he was used as part of an effective private army by the FBI to target vulnerable foreign government websites, using the informant Sabu – real name Hector Xavier Monsegur – as a go-between. Sabu, who was a leading figure in the Anonymous-affiliated hacking group LulzSec, was turned by the FBI into one of its primary informants on the hacker world after he was arrested in 2011, about six months before the Stratfor website was breached.

Referring to the hacking of foreign government websites, Hammond said that in one instance, he and Sabu provided details on how to crack into the websites of one particular unidentified country to other hackers who then went on to deface and destroy those websites. “I don’t know how other information I provided to [Sabu] may have been used, but I think the government’s collection and use of this data needs to be investigated,” he told the court

He added: “The government celebrates my conviction and imprisonment, hoping that it will close the door on the full story. I took responsibility for my actions, by pleading guilty, but when will the government be made to answer for its crimes?”

Hammond’s 10-year federal prison service makes it one of the longest punishments dished out for criminal hacking offences in US history. It joins a lengthening line of long jail terms imposed on hackers and whistleblowers as part of the US authorities' attempt to contain data security of government agencies and corporations in the digital age.

Preska also imposed a three-year period of probationary supervision once Hammond is released from jail that included extraordinary measures designed to prevent him ever hacking again. The terms of the supervision state that when he is out of prison he must: have no contact with “electronic civil disobedience websites or organisations”; have all his internet activity monitored; subject himself to searches of his body, house, car or any other possessions at any time without warrant; and never do anything to hide his identity on the internet.

Hammond’s 10-year sentence was the maximum available to the judge after he pleaded guilty to one count of the Computer Fraud and Abuse Act (CFAA) relating to his December 2011 breach of the website of the Austin, Texas-based private intelligence company Strategic Forecasting, Inc. Delivering the sentence, Preska dismissed the defendant’s explanation of his motivation as one of concern for social justice, saying that he had in fact intended to create “maximum mayhem”. “There is nothing high-minded and public-spirited about causing mayhem,” the judge said.

She quoted from comments made by Hammond under various internet handles at the time of the Stratfor hack in which he had talked about his goal of “destroying the heart, hoping for bankruptcy, collapse”. She criticised what she called his “unrepentant recidivism – he has an almost unbroken record of offences that demonstrate an almost total disrespect for the law.”

Before the sentence came down, Hammond read out an outspoken statement to court in which he said he had been motivated to join the hacker group Anonymous because of a desire to “continue the work of exposing and confronting corruption”. He said he had been “particularly moved by the heroic actions of Chelsea Manning, who had exposed the atrocities committed by US forces in Iraq and Afghanistan. She took an enormous personal risk to leak this information – believing that the public had a right to know and hoping that her disclosures would be a positive step to end these abuses.”

In his own case, he said that as a result of the Stratfor hack, “some of the dangers of the unregulated private intelligence industry are now known. It has been revealed through Wikileaks and other journalists around the world that Stratfor maintained a worldwide network of informants that they used to engage in intrusive and possibly illegal surveillance activities on behalf of large multinational corporations.”

Margaret Kunstler, a prominent member of the Hammond’s defence team, told the Guardian after the sentencing that the maximum punishment was “not a great surprise”. She said that Preska had turned Hammond’s own comments in web chats against him, “but I think she doesn’t understand the language that’s used in chat rooms and the internet – for her to have used such language against him and not understand what his comments meant seemed piggy to say the least.”

• This article was amended on 17 November 2013. An earlier version incorrectly described Margaret Kunstler as Hammond’s lead defence lawyer.