President Obama speaks at the Diriyah Palace in Riyadh, Saudi Arabia. (Carolyn Kaster/Associated Press)

Should the United States cut its ties to Saudi Arabia? The question emerges amid fresh controversies and President Obama’s recent visit to the kingdom. I’ve been a critic of Saudi Arabia for decades, but despite all the problems, I think the United States is better off with the alliance than without.

Congress might soon pass a bill that would allow individual Americans — relatives of those who died on 9/11 — to sue the Saudi government. Some of these relatives have also demanded that the Obama administration release 28 pages redacted from a congressional report that examined Saudi involvement in the attacks.

But were the United States to strip the Saudis of the immunity that foreign governments traditionally have, it would make Washington vulnerable to reciprocal actions around the globe. Imagine if the U.S. government faced lawsuits for every one of its drone strikes, bombing raids, special operations — not to mention wars. As for the report, the executive director of the 9/11 Commission, Philip Zelikow, argues that the 28 pages contain “unvetted, raw material” from FBI files that appears “to implicate people in serious crimes without the benefit of follow-up investigation to determine if such charges are valid.”

I believe that Saudi Arabia bears significant responsibility for the spread of a cruel, intolerant and extremist interpretation of Islam — one that can feed directly into jihadi thinking. But as Gregory Gause points out in a forthcoming essay in Foreign Affairs, the story is more complicated. “Saudi Arabia lost control over the global [extremist] movement in the 1980s, and . . . the Saudi regime itself has been targeted by that movement since the 1990s.” After all, if the United States was target No. 1 for al-Qaeda, Saudi Arabia was target No. 2.

In the 1950s, Saudi Arabia’s Wahhabi version of Islam, a product of nomadic desert culture, was practiced by a tiny minority of Muslims — perhaps 1 to 2 percent. Then came the oil boom, and Saudi Arabia — flush with cash — spread these ideas throughout the Muslim world.

The president will travel to Saudi Arabia this week, but renewed scrutiny in allegations that Saudi officials in some way supported the 9/11 terrorist attacks fifteen years ago could make for a complicated trip. (Adam Taylor,Jason Aldag/The Washington Post)

This globalized Wahhabism has destroyed much of the diversity within Islam, snuffing out liberal and pluralistic interpretations of the religion in favor of an arid, intolerant one. In the 1980s, as the war in Afghanistan against the Soviet Union was infused with religious fervor, doctrines of jihad flourished. In many cases, Islamic fundamentalism turned into Islamic terrorism.

In the years after 9/11, after much defensiveness and many denials, the Saudis began to reverse course, shutting down government funding for Islamic extremist movements. David Petraeus once told me that the most significant strategic shift during his time in uniform was that Saudi Arabia went from being a tacit supporter to an aggressive foe of jihadi groups. Today Saudi intelligence is a major ally in fighting al-Qaeda, the Islamic State and other groups.

Yet Saudi funding of Islamic extremism has not ended, and its pernicious effects can be seen from Pakistan to Indonesia. These funds come from individuals, not the government. Still, it is hard to imagine that the Saudi monarchy cannot turn off the pipeline of money to extremists abroad and at home.

Saudi Arabia remains reluctant to take on its religious extremists for fear of backlash. Hard-line religious leaders and ideologues have significant sway in Saudi society. The kingdom is known for its vast and growing social media. Less known is that its biggest stars are Wahhabi preachers and extremist ideologues who are now spreading anti-Shiite doctrines as part of the struggle against Iran. The central dilemma remains: Were the Saudi monarchy to fall, it might be replaced not by a group of liberals and democrats but rather by Islamists and reactionaries. Having watched this movie in Iraq, Egypt, Libya and Syria, I am cautious about destabilizing a regime that is in many areas — defense, oil, finance — a stable ally.

Saudi Arabia has created a monster in the world of Islam, a Frankenstein monster that threatens Saudi Arabia as much as the West.

The Saudi monarchy must reform itself and its export of ideology. But the reality is, this is far more likely if Washington engages with Riyadh rather than distancing itself, leaving the kingdom to fester in isolation. Foreign policy means dealing with the world as it is, not as you wish it to be. It requires forgoing the satisfaction of a grand moral victory and accepting instead possibly frustrating quarter-measures. In few cases is this more true than in the United States’ relations with this strange desert kingdom.

Read more from Fareed Zakaria’s archive, follow him on Twitter or subscribe to his updates on Facebook.