ON THE ultra-right fringes of the Anglophone blogosphere, Vladimir Putin has many admirers who credit him with a robust antipathy to Islam. For example, he is supposed to have said, contemptuously, that if people "prefer sharia law...then we advise them to go to other places where that is the state law." In fact, the quote is apocryphal, and it would have been an odd thing to say. Mr Putin is more pragmatic than that. As it happens, sharia is vigorously practised on Russian soil, in Chechnya, where hundreds of thousands of people rallied this week against the Charlie Hebdo cartoons, egged on by the territory's pro-Moscow leader, Ramzan Kadyrov. In fact, the people who look to Mr Putin as a beacon of Islamophobia might be surprised by the things that he has actually said. For example, he has spoken of the commonalities between his own faith, Russian Orthodoxy, and Islam. "Some analysts of Christianity say Orthodoxy is in many respects closer to Islam than to the Catholics," he once declared, while stressing that he couldn't judge the matter himself. Yes, those were his exact words; it would have been contentious enough if he had merely stated that Orthodoxy and Islam were a closer pair (or less far apart) than Catholicism and Islam, but from the videotape (in Russian), it's clear that he is making an even bolder claim.

As Mr Putin freely admits, he is not a theologian. He is more comfortable when placing Islam in the broad sweep of imperial history. In October 2013 he made a resonant journey to the central Russian city of Ufa, a Muslim stronghold. The event was to celebrate the 225th anniversary of the establishment by Empress Catherine of a Muslim spiritual authority whose job was to guide the faithful and guarantee their loyalty to Russia. "Islam is an outstanding element of Russia's cultural makeup, an integral, organic part of our history," Mr Putin told his hosts. But his exact words don't matter so much. The occasion itself was a signal that today's Russia sees itself as a proud successor to an imperial realm which co-opted rather than converted the religious communities that lay in its path. Like the tsars, today's Russia sees no contradiction between fighting certain forms of Islam in the Caucasus and shoring up that faith, in return for guarantees of loyalty, in other parts of its domininion.

And since Catherine's time, many imperial powers have made similarly expedient calculations. During his expedition to Egypt, Emperor Napoleon stressed his admiration for Muhammad and hobnobbed with Islamic scholars. There have been debates over whether he actually converted to Islam; but he probably spoke the truth when he said "it is by making myself Muslim that I established myself in Egypt"—just as he had stressed his Catholic roots when subduing restive parts of France.

When Britain was at the zenith of its imperial power, it also took careful account of its Muslim subjects' feelings. Having made the terrible mistake of triggering a rebellion in India in 1857 by offending both Muslims and Hindus, it steadily gained sophistication in the handling of religious sensitivities. Although it wasn't always the decisive factor, the likely reaction of Muslims under the Raj was always taken into account when Britain weighed up its strategic options. In the twilight of empire, Britain became rather skilled at intra-Muslim diplomacy; the establishment of the Saudi throne, whose occupant has just changed, owed much to Britain.

In his Ufa speech, Mr Putin said Russia had been far ahead of its European rivals in establishing a model for co-existence between faiths. In a way, that is true. But co-existence under a common, imperial regime—one that punishes "blasphemers" of all kinds, including those who challenge the regime itself, and colludes with religious authorities to maintain social control—is different from the liberal model of co-existence, where no religion is protected and each must argue its case in an open market-place of ideas.

After the Paris terrorist attacks, lots of countries will give each other lectures about how to manage co-existence between cultures and religions. Placing all faiths and ethnicities under a single iron fist and co-opting their elites is one way of doing it, and that approach will always have its advocates. That is how traditional empires worked, and something similar was done by the Soviet communists. Establishing a democratic space where all opinions are respected, based on a deep consensus on the value of freedom of speech, is a harder and longer road, but a better guarantee of peace. And whatever your religious views, it's nicer to live in places where blasphemers don't get whipped.