DUBAI - When Saudi Arabia's Grand Mufti Sheikh Abdulaziz Al al-Sheikh described Islamic State and al Qaeda as "kharijites" last month, he was casting them as the ultimate heretics of Muslim history, a sect that caused the faith's first and most traumatic schism.
That sort of rhetoric aimed at expelling militants from the Muslim mainstream has grown increasingly common among top Saudi clerics in recent weeks as they work to counter an ideology that threatens their political allies in the Al Saud dynasty.
But while Saudi Arabia's official Wahhabi school of Sunni Islam attacks Islamists as heretical and "deviant", many of its most senior and popular clergy preach a doctrine that encourages intolerance against the very groups targeted by IS in Iraq.
The arch conservatives Abdulrahman al-Barrak and Nasser al-Omar, who has more than a million followers on Twitter, have accused Shi'ites of sowing "strife, corruption and destruction among Muslims".
Sheikh Saleh al-Luhaidan was sacked as judiciary head in 2008 for saying owners of media that broadcast depravity have forsaken their faith, a crime punishable in Sharia law by death, but he remains a member of the kingdom's top Muslim council.
Abdulaziz al-Fawzan, a professor of Islamic law and frequent guest on the popular al-Majd religious television channel, has accused the West of being behind the Sept. 11, 2001 attacks on the United States, saying "these criminals want to take control over the world".
Such opinions, which echo the views of militants in Iraq, are not unusual in Saudi Arabia, which applies Sharia Muslim law, has beheaded 20 people in the past month, and where clerics oversee a lavish state-funded religious infrastructure.
Saudi Arabia and its ultra conservative Wahhabi school are often seen in the West as the ideological wellspring of al Qaeda, which has staged attacks across the world and of Islamic State, which has beheaded hostages in Syria and Iraq.
It is a viewpoint vociferously denied by the Saudi establishment, including the ambassador to London, Prince Mohammed bin Nawaf, who wrote last month that it "does not even faintly correspond" with Wahhabi teachings.
The Al Saud are sensitive to such criticism not only because of the costs of suppressing a militant insurgency a decade ago that killed hundreds, but because their legitimacy rests partly on religious credentials underwritten by Wahhabi clerics.
Saudi authorities point to the influence of the radical wing of the Muslim Brotherhood in developing modern jihadi thinking, but play down Riyadh's decades of support for Islamists around the world as a counterweight to anti-royal leftist ideology.
The government's inability or reluctance to crack down on expressions of intolerance towards non-Sunnis has led some Saudi liberals and foreign analysts to ask if the kingdom is committed to tackling radicalism's roots, or only its symptoms.
"It's their definition of extremism we may not agree with. It is still very mainstream to call Shi'ites infidels. That's not seen as extremist," said Stephane Lacroix, author of Awakening Islam, a book about Islamism in Saudi Arabia.
When the Al Saud first raised a state near Riyadh in the mid 18th century, they did so with the support of a local preacher, Mohammed ibn Abd al-Wahhab, whose purist doctrine is often known as Wahhabism, a term rejected by those who follow it.
Wahhabi ideology is focused on eliminating incorrect doctrine, particularly when it appears to undermines monotheism, a category that includes Shi'ite reverence for the Prophet Mohammed's descendents and the Christian belief in a trinity.
Like Shi'ites, the Kharijites wanted Mohammed to be replaced as leader of the Muslims by his son-in-law, Ali, but they later assassinated him for compromising with the early Sunnis. That act won them the enmity of both Islam's main sects.
Wahhabi clergy offer legitimacy and public support to a king who styles himself "custodian of the two holy mosques", and leave all matters of governance and foreign policy to him so long as his edicts do not contradict Muslim law.
In return, the ruling family has given them top government jobs, control over Saudi Arabia's Sharia Muslim law, great influence over social issues and public morality, and funds for foreign evangelism and massive Wahhabi seminaries.
Riyadh, which sees itself as a protector of Sunnis against Shi'ite factions manipulated by an expansionist Iran, has given arms and cash to Syrian rebels fighting President Bashar al-Assad, a member of the Alawite sect close to Shi'ites.
But it also sees militant groups among the rebels, including IS and the Nusra Front, as a threat to its own security, fearing that thousands of Saudi nationals who have gone to fight there will be radicalised and target their own country.
It has declared both groups illegal and imposed long prison terms for any who offer them support, help them raise money or join them to fight.
That position is backed by the Wahhabi establishment, which has declared the struggle in Syria a jihad, or holy war, for the Syrian people, but not for Saudis, and repeatedly urged citizens not to go to fight.
"Peace and war have to be directed by the government and the king himself. As for those encouraging others to go and fight, I don't agree with it at all. It doesn't comply with our religion and it's not legal," said Sheikh Abdulmohsen Al al-Sheikh, a former member of the Sharia faculty at Mecca's Umm al-Qura seminary.
The militants, in turn, often cite Wahhabi clerics from the 18th and 19th century, but they regard their modern successors as tools of the Saudi government, which they have vowed to topple with the slogan "kadimoun" or "we are coming".
"The jihadis stopped citing senior mainstream Saudi clerics many years ago," said Thomas Hegghammer, a research fellow at the Norwegian Defence Research Establishment and author of Jihad in Saudi Arabia.
Even the few Saudi clerics who once supported al Qaeda, and are now in prison in the kingdom, are shunned by IS because of its own rift with the older militant group, he said.
However, there are clearly contacts between some lower-level clerics and militants in Iraq and Syria. The authorities said last month they had detained mosque imams who urged people to go and join the fight and prepared sermons for use by IS fighters.
Another cleric was sentenced to five years in prison in August for "glorifying" extremist ideology and urging others to go to Syria to fight. Thousands of Saudis are believed to have joined militant groups in Syria and Iraq.