A Scottish man has been sentenced to 150 hours of community service after being found guilty of writing a “grossly offensive” tweet.

Last year, following the death of Captain Sir Tom Moore, who rose to national prominence for his charitable efforts during the Chinese coronavirus pandemic, Joseph Kelly, 36, posted on social media: “the only good Brit soldier is a deed [dead] one, burn auld fella buuuuurn”.

The Glaswegian man was convicted for sharing “grossly offensive” material online by the Lanark Sheriff Court in January and was sentenced to 150 hours of community service and 18 months of government supervision on Wednesday, The National reported.

Sheriff Adrian Cottam said that Kelly had passed the “custody threshold” for his tweet, meaning that he could have been imprisoned for it, but said that there should be a bias against prison time if another option is available.

“My view is, having heard the evidence, that this was a grossly offensive tweet. The deterrence is really to show people that despite the steps you took to try and recall matters, as soon as you press the blue button that’s it,” said the sheriff, as lower court judges in Scotland are known.

“It’s important for other people to realise how quickly things can get out of control. You are a good example of that, not having many followers,” he added.

Representing Mr Kelly, lawyer Tony Callahan said of his client: “He accepts he was wrong. He did not anticipate what would happen. He took steps almost immediately to delete the tweet but the genie was out of the bottle by then.

“His level of criminality was a drunken post, at a time when he was struggling emotionally, which he regretted and almost instantly removed.”

Following the court finding him guilty, Kelly was further lectured by the sheriff, who stressed how “grossly offensive” it was too make the derogatory statements about Captain Tom in particular, whom he said was “a man who had become known as a national hero, who stood for the resilience of the people of a country struggling with a pandemic and the services trying to protect them.”

Kelly was found guilty under Section 127 of the Communications Act 2003, which criminalises sending messages which are deemed to be “grossly offensive or of an indecent, obscene or menacing character; or [causing] any such message or matter to be so sent.”

While free speech campaigners have sought to have the censorious act repealed, the government of Prime Minister Boris Johnson is actually preparing to impose more restrictions on speech with the introduction of its Online Safety Bill, which seeks to empower the media regulator Ofcom to police social media and impose fines on tech companies that fail to censor according to its standards.

On top of these restrictions on online speech, some 120,000 people are potentially still in police databases for so-called “non-crime hate incidents” — meaning that while they have committed no crime, a record of the supposed offence could still be found through background checks.

Criticising the “free speech problem” in Britain following the conviction of Mr Kelly, Kings College lecturer Stuart Ritchie said: “150 hours of community service for a tweet — and a heavy implication that he should feel grateful not to be sent to prison. For a tweet!”

Follow Kurt Zindulka on Twitter here @KurtZindulka