In this country, and in the US, the judicial authorities make fools of themselves about Twitter. In Saudi and Malaysia, they may make themselves murderers. The case of Hamza Kashgari, a young Saudi journalist who has just been deported from Malaysia to face trial on charges of blasphemy, is one that should frighten and disgust anyone who cares about freedom of speech or religion.

His supposed offence was to have tweeted part of an imaginary conversation with the prophet Muhammad. "I have loved things about you and I have hated things about you and there is a lot I don't understand about you," he wrote; and: "I will not pray for you."

After six hours, he apologised for this, and then fled to Malaysia, en route to New Zealand, where he would have been safe. But after three days in Malaysia, he was arrested and shipped back to Saudi, where he faces the death penalty.

It is likely that he will not be executed, if he makes a sufficiently grovelling apology, though he will certainly be punished cruelly for something that is not a crime in any civilised society. This doesn't do much to excuse either the Saudis or the Malaysian authorities, who were under no compulsion to arrest him, and even less to deport him before his lawyers could lodge an appeal, despite the protests of both Amnesty International and Human Rights Watch.

But the really chilling fact about this story is that his persecutors are the online commenters in Saudi. Some 30,000 tweets, mostly condemning him, came within 24 hours. A Facebook group has been set up to demand Kashgari's punishment (and Facebook has not taken it down). There are 20,000 members already. Some bloggers, it's true, have defended him; but they too have been threatened by the more orthodox contingent.

It has even been reported that someone phoned the BBC Arabic service to complain that the case showed that the Saudi media were controlled by a liberal elite.

In the comments on one Saudi newspaper someone claimed that "the only choice is for Kashgari to be killed and crucified in order to be a lesson to other secularists." The Saudi information minister tweeted that he had burst into tears when he read Kashgari's tweets. "When I read what he posted, I wept and got very angry that someone in the country of the two holy mosques attacks our Prophet in a manner that does not fit a Muslim ..."

"I have given instructions to ban him from writing for any Saudi newspaper or magazine, and there will be legal measures to guarantee that."

One has to wonder whether a man who weeps at comments on the internet has the toughness required to survive in democratic politics, but of course Saudi is not a democracy. It is a despotism, made worse by streaks of populism.

The most horrible thing that dictatorships teach us about human nature is that their worst crimes are often the most popular parts of their programmes.

• Follow Comment is free on Twitter @commentisfree