The diplomatic machinations that have enveloped Saudi Arabia, the United Arab Emirates and Qatar may seem like a membership feud in a Persian Gulf club for the wealthy. But their quarrel highlights battles that have been roiling the Middle East since the Arab Spring began nearly seven years ago.

The boycott against Qatar announced last month by the Saudis, Emiratis, Bahrainis and Egyptians took the Trump administration by surprise — and triggered a mediation effort this week by Secretary of State Rex Tillerson. He is said to view the conflict as counterproductive — damaging all the feuding countries and helping their common rival, Iran.

Tillerson is right to see this as a fratricidal dispute that should be resolved through negotiation. The allegation that Qatar supports terrorism is weak, especially after it signed a memo with Tillerson on Tuesday committing to a joint counterterrorism battle with the United States. The demand that Qatar close Al Jazeera is outrageous; the region needs freer media, not more censorship.

The Saudis’ and Emiratis’ basic problem is that they find Qatar a meddlesome and untrustworthy neighbor. But by escalating the family quarrel so radically, they have hurt themselves. The longer this battle goes, the more damage it will do to gulf relations with Washington, stability in the region and, perhaps most important, hopes for modernization and reform in Saudi Arabia.

If Tillerson wants to resolve this dispute, he needs to reckon with the intensity of the anger that triggered it. The fuse was lit in 2013, but its roots go back to 1996, when a branch of the ruling family the Saudis didn’t like took power against Saudi wishes. For Saudi Arabia and the UAE, Qatar feels like a thorn in the side, much as Cuba did for the United States for more than 50 years.

This secret history emerges in documents published this week by CNN. The network obtained a copy of a handwritten accord signed Nov. 23, 2013, by the ruling monarchs of Saudi Arabia, Qatar and Kuwait. It’s basically a mutual non-interference pact, with the additional stipulation that no signatory will destabilize Yemen or support the Muslim Brotherhood.

It’s the Muslim Brotherhood issue that has caused the most bitterness. Qatar has argued that the Brotherhood’s involvement in politics will defuse extremism, rather than augment it. The Obama administration took a similar view in its outreach to the Brotherhood in Egypt after the fall of President Hosni Mubarak in February 2011, and in its support for President Recep Tayyip Erdogan’s government in Turkey. Both Obama policies are now widely judged to have been failures.

President Barack Obama’s pro-Muslim Brotherhood actions were poisonous to the Saudis and Emiratis and help explain the deep split that developed after Mubarak’s departure in 2011. Rage at Obama deepened as he negotiated the nuclear deal with Iran, another bitter enemy of the gulf Arabs.

The gulf Arabs responded by squeezing Qatar to protect their flanks. The secret November 2013 agreement came just five months after a coup ousting the Brotherhood’s Mohamed Morsi in Egypt, and after Iran had signed a framework nuclear agreement.

Hoping to compel Qatar to cease its regional activism, the gulf states signed a second pact on Nov. 16, 2014, which was described as a “rescue of the first agreement,” Saudi sources said. It was broadened to include the rulers of Bahrain and the UAE. And it added a joint commitment to protect Egypt’s stability (meaning, help suppress the Brotherhood).

Qatari officials argue that they have abided by the non-interference terms of the agreement and that Al Jazeera and other media outlets operate independently. They protest that any complaints regarding the 2014 pact should have been referred to the Gulf Cooperation Council (GCC). The Saudis privately concede that they acted unilaterally because they didn’t have GCC consensus.

What complicates this feud is that nearly everyone has been playing both sides of the street. The Qataris do maintain contact with the Taliban and al-Qaeda’s affiliate in Syria, but they coordinate some of their activities with the CIA. The Qataris do broadcast some extremist Islamist rhetoric, but they also host the biggest U.S. air base in the region. The Saudis and Emiratis want to be America’s best friends, except when they decide that their interests compel unilateral action.

The Qatar quarrel may seem like a tempest in an Arabian teapot. But at its heart is the question that has vexed the world for a decade: Is there a role for political Islam in the modern world? Qatar says yes. The UAE counters that Islamist agitators are the enemy of tolerance and modernity. It falls to Tillerson to see whether there’s a middle ground.

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