And especially since 2003, when Qaeda attacks in the kingdom awoke the monarchy to the danger it faced from militancy, Saudi Arabia has acted more aggressively to curtail preachers who call for violence, cut off terrorist financing and cooperate with Western intelligence to foil terrorist plots. From 2004 to 2012, 3,500 imams were fired for refusing to renounce extremist views, and another 20,000 went through retraining, according to the Ministry of Islamic Affairs — though the United States Commission on International Religious Freedom expressed skepticism that the training was really “instilling tolerance.”

An American scholar with long experience in Saudi Arabia — who spoke on condition of anonymity to preserve his ability to travel to the kingdom for research — said he believed that Saudi influence had often been exaggerated in American political discourse. But he compared it to climate change. Just as a one-degree increase in temperature can ultimately result in drastic effects around the globe, with glaciers melting and species dying off, so Saudi teaching is playing out in many countries in ways that are hard to predict and difficult to trace but often profound, the scholar said.

Saudi proselytizing can result in a “recalibrating of the religious center of gravity” for young people, the scholar said, which makes it “easier for them to swallow or make sense of the ISIS religious narrative when it does arrive. It doesn’t seem quite as foreign as it might have, had that Saudi religious influence not been there.”

Centuries-Old Dilemma

Why does Saudi Arabia find it so difficult to let go of an ideology that much of the world finds repugnant? The key to the Saudi dilemma dates back nearly three centuries to the origin of the alliance that still undergirds the Saudi state. In 1744, Muhammad ibn Abd al-Wahhab, a reformist cleric, sought the protection of Muhammad bin Saud, a powerful tribal leader in the harsh desert of the Arabian Peninsula. The alliance was mutually beneficial: Wahhab received military protection for his movement, which sought to return Muslims to what he believed were the values of the early years of Islam in the seventh century, when the Prophet Muhammad was alive. (His beliefs were a variant of Salafism, the conservative school of Islam that teaches that the salaf, or pious ancestors, had the correct ways and beliefs and should be emulated.) In return, the Saud family earned the endorsement of an Islamic cleric — a puritanical enforcer known for insisting on the death by stoning of a woman for adultery.

Wahhab’s particular version of Islam was the first of two historical accidents that would define Saudi religious influence centuries later. What came to be known as Wahhabism was “a tribal, desert Islam,” said Akbar Ahmed, the chairman of Islamic studies at American University in Washington. It was shaped by the austere environment — xenophobic, fiercely opposed to shrines and tombs, disapproving of art and music, and hugely different from the cosmopolitan Islam of diverse trading cities like Baghdad and Cairo.

The second historical accident came in 1938, when American prospectors discovered the largest oil reserves on earth in Saudi Arabia. Oil revenue generated by the Arabian-American Oil Company, or Aramco, created fabulous wealth. But it also froze in place a rigid social and economic system and gave the conservative religious establishment an extravagant budget for the export of its severe strain of Islam.