The pampered petro-states of Saudi Arabia and United Arab Emirates expected a quick victory after imposing a quasi-blockade on neighboring Qatar. Past crises in relations had been peacefully resolved, but this time Qatar’s antagonists demanded its virtual surrender, particularly abandonment of an independent foreign policy. They believed they had Washington behind them.

Alas, the intervening weeks have not been kind to Riyadh and UAE. They now say they are willing to negotiate previously “nonnegotiable” demands. A further retreat seems likely.

Everything started going wrong when Secretary of State Rex Tillerson and Defense Secretary Jim Mattis signaled their support for Doha. Tillerson demonstrated obvious impatience with demands he viewed as extreme and not even worth negotiating, and called Qatar’s positions “very reasonable.”

Then more than a few critics observed that Riyadh and Dubai are even guiltier than Qatar in funding terrorism. One of them was Senate Foreign Relations Committee Chairman Bob Corker, who complained that “The amount of support for terrorism by Saudi Arabia dwarfs what Qatar is doing.” Indeed, the Kingdom long has been the most dangerous incubator of intolerance in the entire Middle East. In response to the controversy Doha inked an agreement with the U.S. on targeting terrorist financing, which none of Qatar’s accusers had done.

George Washington University Professor Marc Lynch observed that “The extremist and sectarian rhetoric which external forces brought to the Syrian insurgency was a problem extending far beyond Qatar.” The demand to shut Al Jazeera by nations which have no free press and even criminalized the simple expression of sympathy for Qatar was denounced globally.

Then came reports that U.S. intelligence concluded the UAE had hacked the official Qatar website a couple months ago, creating the incendiary posts allegedly quoting Qatar’s emir which helped trigger the crisis. In contrast, Bahrain and Egypt, which joined the anti-Doha bandwagon, looked like mere hirelings, doing as they have been told by states which provided financial and military aid. Having initiated hostilities without a back-up plan, the anti-Qatar coalition can move neither forward nor backward without a huge loss of face. But staying the course looks little better. Saudi Arabia and UAE caused Qataris to rally behind their royal family, wrecked the Gulf Cooperation Council, eased Iran’s isolation, pulled Turkey directly into Gulf affairs, and challenged Washington. Quite an achievement.

The experience has yielded several important lessons.

President Donald Trump huffs and puffs, but doesn’t have much to do with U.S. foreign policy. Despite having criticized Saudi Arabia in the past, he flip-flopped to become Riyadh’s de facto lobbyists in Washington. However, his very public preferences have had little impact on U.S. policy, which ended up tilting strongly against UAE and Saudi Arabia. He recently acknowledged that he and Secretary Tillerson “had a little bit of a difference, only in terms of tone.”

Saudi Arabia proved to be more paper tiger than regional leader. It spent lavishly on weapons, subsidized other Muslim states, sought to overthrow of Syria’s Assad regime, and launched a brutal war against Yemen, but had no response prepared when Qatar dismissed Riyadh’s demands. Then Secretary Tillerson effectively blocked any escalation. With the expiration of the Saudi-UAE ultimatum several weeks ago some observers feared that Saudi Arabia and UAE would impose additional sanctions, expel Qatar from the GCC, or even invade their independent neighbor. But Secretary Tillerson made all of those steps more difficult if not impossible in practice.

Indeed, the secretary’s shuttle diplomacy to support the Kuwaiti mediation attempt even forced Qatar’s accusers to effectively negotiate what they had termed nonnegotiable. UAE Minister of State Noura al-Kaabi said “We need a diplomatic solution. We are not looking for an escalation.” More recently Abu Dhabi and Riyadh, along with their subsidized allies, Bahrain and Egypt, offered to engage in a dialogue with Qatar. No wonder the Saudis, who once believed they had coopted America’s president, now complain that America’s secretary of state is backing Doha.

Saudi Arabia’s expensive overseas diplomacy has been of dubious value, gaining the Kingdom few friends. Riyadh and UAE organized an inconsequential coalition featuring dependents Bahrain and Egypt, international nullity Maldives, and one of the contending governments in fractured Libya. Since then the group has failed to win meaningful support from any other state. The problem? The real issue isn’t terrorism, but far more selfish concerns, such as support for domestic political opponents.

The reputation of the accusers has tanked. Discussion of the controversy almost inevitably resulted in more attention to the misbehavior of Riyadh and Abu Dhabi, particularly their brutal repression of any political and religious dissent at home, Saudi Arabia’s lavish funding for the extremist and intolerant Wahhabist strain of Islam, and UAE’s initiation of cyber-hostilities against Doha. Tom Wilson of the London-based Henry Jackson Society recently published a report calling Riyadh the “foremost” funder of terrorism in the United Kingdom and citing concerns that “the amount of funding for religious extremism coming out of countries such as Saudi Arabia has actually increased in recent years.” While Qatar was vulnerable to criticism over its backing for some radical groups, Riyadh and Abu Dhabi had been subject to even harsher U.S. attacks.

Iran continued to gain more from the actions of its antagonists than its own efforts. Doha and Tehran are linked by a shared natural gas field. Their relationship is one of Saudi Arabia’s chief complaints. Iran is a malign actor, but Riyadh, a totalitarian Sunni dictatorship, is worse. Saudi Arabia intervened militarily in Bahrain to sustain the Sunni monarchy against the Shia majority and backed radical insurgents to oust Syrian President Bashar al-Assad. The reckless new Crown Prince, Mohammed bin Salman, orchestrated the murderous, counterproductive war in Yemen and diplomatic/economic attack on Qatar in order to achieve Gulf hegemony. Now, without firing a shot, Iran helped thwart Riyadh’s latest scheme, won the gratitude of Qataris, and put a reasonable face on the Islamist regime.

Secretaries Tillerson and Mattis deserve special credit. By ignoring President Trump’s misdirected enthusiasm for the Saudi monarchy, they helped shift public attention back to Riyadh and Abu Dhabi. Neither has demonstrated sufficient interest in cutting terrorist funding.

For instance, in a lengthy cable dated December 30, 2009, released by Wikileaks, the State Department criticized Qatar and UAE, but was toughest on Saudi Arabia: “it has been an ongoing challenge to persuade Saudi officials to treat terrorist financing emanating from Saudi Arabia as a strategic priority.” Moreover, “donors in Saudi Arabia constitute the most significant source of funding to Sunni terrorist groups worldwide.” The Kingdom “remains a critical financial support base for al-Qaeda” and other terrorist organizations. Despite Riyadh’s policies, “groups continue to send money overseas and, at times, fund extremism overseas.”

If Saudi Arabia and UAE cared about terrorism, they would look inward first. And Riyadh would stop funding Wahhabism, an intolerant Islamic teaching which demonizes those who believe differently. The consequences of this funding may be more long-lasting than payments to the terrorist group du jour. Norwegian anti-terrorism analyst Thomas Hegghammer observed “If there was going to be an Islamic reformation in the 20th century, the Saudis probably prevented it by pumping out literalism.” Wilson observed: “a growing body of evidence has emerged that points to the considerable impact that foreign funding has had on advancing Islamist extremism in Britain and other Western countries.”

What really bothers Saudi Arabia and the UAE is Doha’s support for opposition groups. For instance, both Riyadh and Egypt fear the Muslim Brotherhood, which offers a flawed but serious life philosophy—and does not promote terrorism. The Saudi royals are insecure because a kleptocratic, totalitarian monarchy holds little appeal to anyone other than the few thousand princes who live lavishly at everyone else’s expense. Similar is the Saudi and Emirati demand that Qatar shut TV channel Al Jazeera, which has criticized both regimes.

Riyadh also wants to conscript all of its neighbors in its campaign to isolate Iran, yet has applied no pressure on UAE which, like Qatar, has maintained ties with the Islamist regime. Anyway, it would be far better to promote long-term change by continuing to draw Iran’s population Westward in opposition to the Islamist elites. By playing host to groups as diverse as the Taliban and Hamas, Doha actually has drawn controversial organizations away from more radical governments, such as Iran’s, and enabled the West to have unofficial contact with groups with which it is officially at odds, such as the Taliban.

Riyadh and Abu Dhabi have sown the wind. Now the entire Gulf will reap the whirlwind. Their attack on Qatar further destabilized the Middle East, unsettling several of Washington’s closest allies. The Saudis and Emiratis ended up in a global cul-de-sac, isolating themselves more than Qatar. The latter has little incentive to yield, while the former face debilitating humiliation if they abandon their claims. Other governments increasingly expect a lengthy stand-off. Secretary Tillerson predicted that the “ultimate resolution may take quite a while.”

That will benefit no one, other than Iran, perhaps. Not Qatar. Not America. And certainly not Saudi Arabia and the UAE.

The U.S. can’t impose a settlement on its dubious allies. But Washington can recognize that “there are no clean hands here,” as a State Department spokesman recently observed. The Trump administration should place full responsibility for the current stand-off where it belongs, on Riyadh and Abu Dhabi. They should be the countries punished by international isolation.