A man who wore a homemade T-shirt containing an offensive anti-police sentiment in the immediate aftermath of the deaths of PCs Fiona Bone and Nicola Hughes has been jailed for a total of eight months.

Barry Thew, 39, of Radcliffe, Manchester, was sentenced at Minshull Street crown court in Manchester to four months in prison, after admitting a section 4a public order offence – displaying writing or other visible representation with intention of causing harassment, alarm or distress. Thew also admitted breaching a suspended sentence imposed for a previous offence of cannabis production for which he was ordered to serve another four months concurrently.

The court heard that at 2.15pm on 18 September, less than three-and-a-half hours after the officers were killed, he was seen in Radcliffe town centre wearing a white T-shirt with the handwritten message on the front and back. He was arrested and taken into custody after complaints from outraged members of the public.

The T-shirt said on its front: "One Less PiG Perfect Justice." On the back: "KiLL A COP 4 Fun.co.uk HA, haaa?"

Inspector Bryn Williams, of the Radcliffe neighbourhood policing team, said: "While officers on the ground were just learning of and trying to come to terms with the devastating news that two colleagues had been murdered, Thew thought nothing of going out in public with a T-shirt daubed with appalling handwritten comments on."

He said thankfully the overwhelming response from the public – who have inundated the force with messages of support and condolence – prove that Thew is an exception, not the rule "and our communities were right behind us at our darkest hour".

Williams said to mock the tragic events of that morning was morally reprehensible and Thew had rightly been convicted and sentenced for his actions.

Sentencing him, Judge Peter Lakin said: "This, on any view, is a shocking case. Your response to the shocking events was to parade around in a T-shirt in the centre of Radcliffe which had on it the most disgusting of slogans. In my judgment, it is utterly depressing that you felt able to stoop so low as to behave in that way. Your mindless behaviour has added to the pain of everyone touched by the deaths of these young officers. You have shown no remorse."

When arrested, Thew replied: "Not bothered." The court heard that he was arrested after police received reports from outraged members of the public.

Stuart Duke, defending, said Thew had been an inpatient at a mental health unit and was still on anti-psychotic medicine, but the judge replied mental health was "not a factor".

He said Thew had a longstanding dispute with Greater Manchester police over the death of his son three years ago and repeated stop-and-search procedures. He said the wearing of the T-shirt was not in response to the deaths of the two police officers, but was related to another case. He said he was already wearing the T-shirt when he heard the news.

PCs Nicola Hughes, 23, and Fiona Bone, 32, were killed on duty in a gun and grenade attack when they responded to a routine call about a burglary at an address in Abbey Gardens, on the Hattersley estate in Mottram, Tameside on 18 September.

Dale Cregan, 29, has been charged with their murders and those of David Short and his son, Mark, and four other attempted murders. Thousands of people lined Manchester city centre last week for the officers' funerals.