Last week, only three days after a suicide bomb went off in Lahore, an Islamic State supporter struck a crowd of Sufi dancers celebrating in the great Pakistani shrine of Sehwan Sharif. The attack, which killed almost 90, showed the ability of radical Islamists to silence moderate and tolerant voices in the Islamic world.

The attack also alarmingly demonstrated the ever-wider reach of Isis and the ease with which it can now strike within Pakistan. Isis now appears to equal the Taliban as a serious threat to this nuclear-armed country.

The suicide bombing of the Sehwan shrine is an ominous development for the world, in a region that badly needs stability. It is an Islamic shrine where outsiders, religious minorities and women are all welcomed. Here, 70 years after partition and the violent expulsion of most of the Hindus of Pakistan into India (and vice versa with Muslims into Pakistan), one of the hereditary tomb guardians is still a Hindu, and it is he who performs the opening ritual at the annual festival. Hindu holy men, pilgrims and officials still tend the shrine.

But the wild and ecstatic night-long celebrations marking the Sufi saint’s anniversary were almost a compendium of everything Islamic puritans most disapprove of: loud Sufi music and love poetry sung in every courtyard; men dancing with women; hashish being smoked. Hindus and Christians were all welcome to join in the celebrations.

Since the 1970s, Saudi oil wealth has been used to spread such intolerant beliefs across the globe

A radical anti-Sufi movement is growing throughout the Islamic world. Until the 20th century, ultra-orthodox strains of Islam tended to be regarded as heretical by most Muslims. But since the 1970s, Saudi oil wealth has been used to spread such intolerant beliefs across the globe. As a result, many contemporary Muslims have been taught a story of Islamic religious tradition from which the tolerance of Sufism is excluded.

What happens at the Sehwan Sharif shrine matters, as it is an indication as to which of the two ways global Islam will go. Can it continue to follow the path of moderate pluralistic Islam, or – under the pressure of Saudi funding – will it opt for the more puritanical, reformed Islam of the Wahhabis and Salafis, with their innate suspicion (or even overt hostility) towards Hinduism, Christianity and Judaism?

Islam in south Asia is changing. Like 16th-century Europe on the eve of the Reformation, reformers and puritans are on the rise, distrustful of music, images, festivals and the devotional superstitions of saints’ shrines. In Christian Europe, they looked to the text alone for authority, and recruited the bulk of their supporters from the newly literate urban middle class, who looked down on what they saw as the corrupt superstitions of the illiterate peasantry.

Hardline Wahhabi and Salafi fundamentalism has advanced so quickly in Pakistan partly because the Saudis have financed the building of so many madrasas that have filled the vacuum left by the collapse of state education.

‘The Saudis have financed the building of many madrasas that have filled the vacuum left by the collapse of state education.’ Photograph: Mohammad Sajjad/AP

On my last visit to Sehwan a few years ago, the largest madrasa there was located in an old haveli not far from the shrine of Lal Shahbaz Qalander. Saleemullah, who ran the madrasa, was a well-educated young man, but there was no masking the puritanical severity of some of his views. For him, the theology of the dispute between the Sufis and the orthodox was quite simple: “We don’t like tomb worship,” he said. “The Qur’an is quite clear about this ... We must not pray to dead men and ask things from them, even the saints.”

He saw his role as bringing “the idol and grave-worshippers from kufr [infidelity] back to the true path of the sharia”. He said: “Mark my words, a more extreme form of the Taliban is coming to Pakistan.”

Saleemullah claimed most people wanted a return to the caliphate and said Pakistan’s intelligence agencies were on his side. And when the caliphate comes, he said: “It will be our duty to destroy all the mazars [mausoleums] and the dargahs [shrines] – starting with the one here in Sehwan.”

Saleemullah’s organisation alone ran 5,000 madrasas across Pakistan, and was opening a further 1,500 in Sindh. According to one recent study there are now 27 times as many madrasas in Pakistan as there were in 1947 – over 8,000 in total.

The religious tenor has been correspondingly radicalised: many Sufi sites and people have come under attack, including the Data Darbar shrine in Lahore in 2010 and the revered Sufi singer Amjad Sabri, who was assassinated last summer.

With its deep roots in south Asian soil, its gentle message and through the music that carries it, Sufism has become an antidote to Isis-style radicalism, and fundamentalisms of all sorts. One old fakir I talked to in the Sehwan shrine said of the Wahhabi mullahs: “Without love, they distort the true meaning of the teaching of the prophet.”

If only the Pakistani government could finance schools that taught respect for the country’s own indigenous and syncretic religious traditions, rather than buying fleets of American F-16 fighters and leaving education to the Saudis. Instead, Pakistan is increasingly coming to resemble a tragic clone of pre-9/11 Taliban Afghanistan – a place where violent radicals are welcomed with open arms, where groups like Isis are rapidly gaining influence, and where moderate Muslims and religious minorities are subject to persecution and murder.