It’s official: jokes can now land you in prison. Markus Meechan – known on YouTube as Count Dankula – has been found guilty in a Scottish court of law for the crime of hate speech and breaching the electronic communications act. His arrest followed a viral online video in which Meechan can be seen encouraging his girlfriend’s pug to give a Nazi salute and to respond enthusiastically to the phrase ‘gas the Jews’. His sentence will be passed at Airdrie Sheriff Court on 23 April.

The intention behind the video is unambiguously comedic; the very concept of a Nazi pug could hardly be interpreted otherwise. This has not stopped Sheriff Derek O’Carroll, the judge presiding over this case, from finding Meechan guilty and declaring that ‘the description of the video as humorous is no magic wand’. Without wishing to resort to stereotypes, I can think of no one less qualified to assess the merits of comedy than the Scottish judiciary. The notion that free speech is not under threat in this country is no longer a sustainable claim. Meechan may not be the first to be prosecuted for offensive jokes, but his case sets a particularly dangerous precedent by which even professional comedians might be criminalised for their material. This kind of gradual authoritarianism has already emerged in Canada, where comedian Mike Ward was fined $42,000 by the Quebec Human Rights Tribunal for telling a joke about a disabled boy. The seemingly unstoppable rise of offence culture, largely fuelled by social media, means that the UK is unlikely to be far behind.

That Meechan’s case made it to court in the first place is sufficient to raise serious questions about the credibility of the Procurator Fiscal Service in Scotland. The case appears to rest on the assumption that Meechan’s video was an attempt to incite religious hatred. During the trial, it was described as ‘an odious criminal act that was dressed up to look like a joke’. Even if you don’t consider the video itself to be funny, surely the concept of attempting to inflame anti-Semitism through the medium of pugs is inherently laughable. An important aspect of the prosecution’s strategy was outlined by Meechan himself in a statement after the verdict. For the Nazi pug video to be deemed both threatening and offensive, it was essential that the judge disregard the principles of context and intent. In other words, the joke had to be wilfully misunderstood in order to justify the conviction. Accordingly, the prosecutor described the ‘inclusion of the dog’ as ‘an attempt to muddy the waters around [Meechan] making, producing and posting the video. He says that he knows the context of the video, but in a criminal court in Scotland he does not decide the context of anything, the court decides the context.’ It’s astounding that such a farcical trial could produce such sinister pronouncements.

As for intent, it takes a particularly acute form of stupidity to deny that Meechan was attempting to be funny. He even explains the joke to his audience at the beginning of the video. ‘My girlfriend is always ranting and raving about how cute and adorable her wee dog is’, he says, ‘so I thought I would turn him into the least cute thing that I could think of, which is a Nazi’. As David Baddiel has pointed out, by explaining the conceit Meechan has contravened one of the basic rules of comedy, but even with this helping hand the prosecution has somehow struggled to understand the joke. Given the circumstances, one would be forgiven for concluding that the prosecutors and police involved in this case must have the combined intellectual capabilities of a jellyfish. In truth, the implications are far more troubling. Given that the prosecutors cannot be sincere in their belief that Meechan had intended to incite religious hatred, we are left with only one reasonable alternative: that the state’s desire to protect people from offence now takes priority over their duty to uphold the fundamental democratic principle of freedom of expression.

Meechan’s guilty verdict is a fittingly absurd conclusion to an already absurd case. In the two years since he uploaded his video, this trial has gained little in the way of media attention. Public support for his ordeal has been scant, possibly out of a fear of association with some of the prominent right-wing figures who have defended Meechan’s right to free speech. However, this is a case that must surely transcend political differences. Even those of us who find the video distasteful should rally behind its creator, because if we allow the state to abuse its power in this way, to determine what we can and cannot joke about, we can no longer lay claim to be living in a free society. Andrew Doyle is a stand-up comedian and spiked columnist. He is the co-writer of Jonathan Pie: Back to the Studio, a new live show currently touring the UK. He is also the co-founder of Comedy Unleashed, London’s free-thinking comedy club. Follow Andrew on Twitter: @andrewdoyle_com