The rupturing of diplomatic relations between Qatar and five regional states—Bahrain, Egypt, Saudi Arabia, the United Arab Emirates (UAE), and the internationally recognized Yemeni government-in-exile—has brought to a head a long-simmering dispute about the country’s distinctive approach to regional affairs.

Bahrain, Saudi Arabia, and the UAE, last cut ties with Qatar in 2014, withdrawing their ambassadors from the country for nine months. But this latest standoff has gone markedly further. For one thing, it includes economic sanctions—and given that Qatar’s only land border is with Saudi Arabia, any disruption to the flow of goods and people by air, land, or sea, could cause rapid economic dislocation and lead to social or political unrest.

While it remains unclear what the Saudi and Emirati endgame is, the roots of the tensions between Qatar and its neighbors go deep, predating the Arab Spring in 2011 and Qatar’s subsequent high-profile support for Islamist transitions in North Africa and Syria. In fact, nearly every “crisis” in the six-member Gulf Cooperation Council (GCC) over the past quarter-century has, in some way, involved Qatar. The other Gulf leaders’ patience with Doha’s sometimes-maverick regional policies may have finally snapped.

Qatar extends northward into the Persian Gulf from Saudi Arabia. In the mid-nineteenth century, the al Thani family emerged as its preeminent local power brokers. In 1868, they reached an agreement with Britain, then the paramount power in the Gulf, that recognized their leadership over the peninsula. Prior to their emergence, parts of the Qatari peninsula had been settled by the al Khalifa family, the present-day rulers of Bahrain. Although the al Khalifa family has ruled Bahrain since 1783, it was locked in a territorial dispute with Qatar over the Hawar Islands, which both countries claimed as their own, until the issue was settled at the International Court of Justice in 2001. Bahrain and Qatar came to the brink of conflict over the islands in 1986, and the two countries only established full diplomatic relations in 1997, fully 26 years after becoming sovereign states.

A September 1992 skirmish on the Saudi-Qatari border that left three people dead illustrated the pitfalls of the longstanding failure to properly demarcate Qatar’s only land boundary. Though the two countries had signed a border agreement in 1965, it was never properly ratified, and was cancelled by Qatar after the border clash. Qatar and Saudi Arabia supported different sides in the brief Yemeni civil war of 1994, and Qatar also objected vociferously to the proposed appointment of a Saudi as secretary general of the GCC in 1995. In response, the Qatari delegation walked out of the closing session of the annual GCC summit in December 1995 and declared its intent to boycott all future meetings attended by the secretary general; the country even reportedly considered cancelling its membership in the GCC.

Much of the anger that has defined the relationship between Qatar and its neighbors since 2011 originated in the policies of its emir, Sheikh Hamad bin Khalifa al Thani, after he seized power from his father in a bloodless palace coup in June 1995. Together with his foreign minister, Sheikh Hamad bin Jassim al Thani, Emir Hamad was instrumental to Qatar’s rise to global prominence in the 1990s and 2000s as he accelerated the development of its liquefied natural-gas infrastructure and forged long-term energy agreements with industrialized and emerging economies worldwide.

Emir Hamad’s accession was, however, not welcomed in neighboring Gulf capitals. Saudi Arabia was implicated in a counter-coup attempt in February 1996 designed to reinstall the ousted Sheikh Khalifa. Following a second attempted counter-coup in 2005, also believed by Qataris to have been instigated by the Saudis, the Qatari government stripped up to 5,000 members of the Bani Murra tribe (whose tribal territory had, historically, straddled the Saudi-Qatari border) of their citizenship in retaliation for the involvement of some of its members in both affairs.

A key preoccupation of Qatar’s post-1995 leadership has been the pursuit of autonomous regional policies designed to bring the country out of the Saudi shadow. Qatar’s support for regional Islamists, notably but not only the Muslim Brotherhood, and provision of Doha-based Al Jazeera as a platform for groups criticizing regional states, incited periods of intense friction. Saudi Arabia withdrew its ambassador from Doha in 2002 in response to Al Jazeera’s coverage of domestic affairs within the kingdom. It took five years to resolve the issue. Tensions rose again thanks to Qatar’s backing of Islamist movements before, during, and after the Arab Spring, as Qatar and the UAE pursued diametrically opposed policies toward the Muslim Brotherhood. Egypt and Libya became battlegrounds for regional influence as Doha and Abu Dhabi backed different sides.

At the time of the handover of power from Emir Hamad to his 33-year old son, Emir Tamim, in June 2013, hopes were high in Riyadh and Abu Dhabi that the young new emir would recalibrate Qatar’s approach to regional affairs. However, in November 2013, five months into Tamim’s rule, Saudi and Emirati leaders reacted viscerally to reports in U.S. media outlets that members of the Muslim Brotherhood were regrouping in Doha following the toppling of Egypt’s President Mohamed Morsi and the institution of military rule. Emir Tamim was summoned to Riyadh by King Abdullah of Saudi Arabia and presented with an ultimatum to “change Qatar’s ways and bring the country in line with the rest of the GCC with regards to regional issues.” Tamim was also told to sign an additional security agreement that stipulated “non-interference” in the “internal affairs of any of the other GCC countries,” and sign a pledge of compliance.

That crisis would peak in March 2014, when Saudi Arabia and the UAE judged that Qatar was not in full compliance with the agreement Tamim signed. Together with Bahrain, they withdrew their ambassadors from Doha. For the UAE, whose leadership was cracking down on the Muslim Brotherhood, a particular flashpoint was the discovery that several Emirati members of al-Islah, the Brotherhood’s UAE-affiliated branch, had been given refuge in Doha after fleeing the UAE in 2012. Months of acrimony followed, with periodic attempts at negotiation mediated by Kuwait, whose emir, Sheikh Sabah, reportedly has a close relationship with Emir Tamim. But the dispute ended in November 2014 after a series of Qatari concessions. These included relocating Muslim Brotherhood figures in Doha to Turkey, ordering the Emirati dissidents to leave Qatar, closing Al Jazeera’s Egyptian branch, and enforcing the GCC Internal Security Pact and cooperating closely with GCC partners on matters of intelligence and policing.

The current crisis has, therefore, been building for years. This time, it may have been triggered by a complex prisoner swap that Qatar negotiated in April to release 26 members of a Qatari hunting party, including many members of the Qatari ruling family, who had been taken hostage in Iraq in December 2015. The group had been held by Kitaeb Hezbollah, a Shia militia with links to Iran, and Qatar reportedly negotiated with Iran, Hezbollah, and the Syrian rebel group Jabhat al-Nusra to secure their release.

Allegations that Qatar may have paid up to $500 million for the prisoner exchange caused fury in regional capitals, including Baghdad, where Iraqi Prime Minister Haider al-Abadi claimed that the deal had been done without Iraqi government involvement or approval. While the exact details of the agreement remain unclear, the suggestion that such large sums of money had been paid to violent non-state actors in Iraq, with the tacit connivance of Iran, reinforced perceptions in other Gulf capitals that Qatar’s proximity to such groups posed a threat to regional stability and security.

Although the actions taken thus far fall short of outright acts of war, both Qatar and its accusers are boxed in, and may be unwilling to back down from such a high-profile game of brinkmanship. And yet, any hopes that Saudi and Emirati official might entertain of forcing the Trump administration to take sides will be complicated by the considerable range of U.S. defense, security, and energy interests in Qatar, which cannot be easily unwound or replicated elsewhere. This notwithstanding, the sudden spike in regional tension presents the administration with a problem that defies easy resolution and casts a pall over the afterglow that President Donald Trump enjoyed following his visit to the Gulf two weeks ago.

We want to hear what you think about this article. Submit a letter to the editor or write to letters@theatlantic.com.