A British man who wore a T-shirt that glorified killing police hours after the deaths of two officers was sentenced to four months in jail, prompting condemnation from free-speech campaigners.

Barry Thew, 39, was arrested for wearing a shirt bearing handwritten messages saying “One less pig perfect justice” and “killacopforfun.com” in Radcliffe, near Manchester, on Sept. 18.

His arrest came hours after two police officers in the region of Manchester, northern England, were killed in a gun and grenade attack that shocked Britain.

Thew was sentenced to four months in jail after earlier pleading guilty to a public order offense. He received another four months for breaching the terms of an earlier suspended sentence.

Civil liberties campaigners called the sentence absurd and warned it would have a chilling effect on free speech.

“It’s time we reform the law to protect freedom of speech and focus the police on bringing to justice those who seek to incite harm, not those who cause offense,” said Nick Pickles, director of civil liberties campaign group Big Brother Watch.

But Inspector Bryn Williams, of the Radcliffe Neighborhood Policing Team, called Thew’s T-shirt appalling and welcomed the sentence.

“To mock or joke about the tragic events of that morning is morally reprehensible and Thew has rightly been convicted and sentenced for his actions,” Williams said.