The Anonymous spokesman and journalist Barrett Brown has been given five years in prison after posting a link to data stolen from the US defence firm Stratfor Global Intelligence, hiding evidence, and threatening an FBI agent.

The journalist, who has been detained for two and a half years while awaiting trial, will reportedly have to wait at least a year for supervised release, after which he will have his computer equipment monitored. He will also have to pay $890,250 in compensation to Stratfor and other firms, in addition to a $225 fine.

In a statement Brown said: "Good news! — The US government decided today that because I did such a good job investigating the cyber-industrial complex, they’re now going to send me to investigate the prison-industrial complex."

"For the next 35 months, I’ll be provided with free food, clothes, and housing as I seek to expose wrongdoing by Bureau of Prisons officials and staff and otherwise report on news and culture in the world’s greatest prison system."

Brown was arrested in September 2012 after he threatened an FBI agent through a YouTube video, and was later indicted on 12 charges relating to the attack on Stratfor by Anonymous members in 2011.

Some of the charges against him, which added up to a potential sentence of more than 100 years, were dropped following a plea bargain, but supporters of Brown had hoped the sentence would be further reduced, claiming that a harsh penalty would be damaging to freedom of speech.

Kevin Gallagher, leader of the Free Barrett Brown campaign, told the Guardian that: "Basically, if you share a link to publicly available material without knowing what’s in it – maybe it could contain stolen credit card info – you could be prosecuted."

Despite the joviality of his statement after the sentencing Brown showed contrition in his plea beforehand, claiming that his behaviour towards the FBI had been influenced by drug withdrawal.

He added that he had no right to hide files from the FBI during its investigation, and that he could have better protected his sources through the courts rather than hiding laptops in his kitchen cabinet.

"If I criticise the government for breaking the law but then break the law myself in an effort to reveal their wrongdoing, I should expect to be punished just as I’ve called for the criminals at government-linked firms like HBGary and Palantir to be punished," he said.

However Brown also attacked the behaviour of the US government, criticising its decision not to acknowledge his work as a journalist and the protections afforded to him in that role.

"Journalists are especially vulnerable right now, Your Honour, and they become more so when the FBI feels comfortable making false claims about them," he said.