On December 22, the United Arab Emirates (UAE) prevented Tunisian women under 30 from boarding Emirates airline flights worldwide, reportedly over security concerns. This echoes the Emirati uproar over King Mohammed VI’s visit to Doha in November, when Qatari media faked a photo of the Moroccan king holding a banner reading, “You have the world, we have [Emir] Tamim.” Both events reflect complex diplomatic relations between the Maghreb and the Gulf. Even as Gulf actors have started to seek tactical interactions on a few Maghreb security issues such as the Libya crisis, their approach remains governed by the paradigm of competition between the UAE and Qatar for security influence in North Africa. However, this narrow cooperation could prefigure a more mature, multilateral, and long-term strategic understanding between the Maghreb and Gulf states.

The Maghreb and the Gulf were once driven by widely differing economic, trade, and political concerns that put them in competition with each other on occasion. Yet the Maghreb economy, while characterized by close northern trade relations with the European Union, is becoming more complex and diverse as Morocco in particular is strengthening economic ties to Africa—and may increasingly emulate the Gulf states’ global economic endeavors in the long run. For example, according to the African Development Bank, as of 2016 Morocco is the fifth-largest investor in Africa, where the UAE is the second-largest (and the largest investor in new projects). Likewise, the Maghreb’s security interests no longer lie solely in the Sahara and Sahel. Illegal migration through Libya has made Sahel instability resonate in Europe, where the rise of populist movements have raised concerns over terrorism—driving Europe (and the United States) to seek greater cooperation with the Maghreb countries to stem the flow of migrants and paving the way for greater cooperation on other security issues.

Yet despite a shared Arab identity, these common interests and concerns have failed to translate into deep strategic ties between the Maghreb and Gulf states. More than just geography, a complex congruence of historical, cultural, and societal factors makes greater integration between them difficult. For Morocco and Algeria in particular, ties with the Gulf are also less strategically desirable than with fellow African states. The Gulf states have indeed had a security footprint in the Maghreb the Gulf Cooperation Council (GCC) called on NATO to intervene in Libya’s civil war in 2011, a first step toward their greater security involvement in the Maghreb without U.S. coordination. However, Libya is now caught in the Gulf’s own regional competition, as Qatar supports the internationally recognized government in Tripoli while the UAE backs the Tobruk-based government politically and provides military support to the anti-Islamist General Khalifa Haftar.

Even though the Libyan crisis—as well as the rift between Qatar and the GCC, which further complicates Maghreb attempts to mediate among Libyan factions—has forced the Maghreb and the Gulf to seek narrow cooperation on these regional issues, their coordination has been piecemeal and reactionary rather than strategic.

Algeria opposed the 2011 NATO intervention pushed by the Gulf states in Libya, where it would prefer to use its own knowledge of key local actors to mediate a political settlement. Its stated neutrality in the Qatar crisis belies resentment at Abu Dhabi’s stakes in Libya as well as its mutual diplomatic and economic interests with Doha: Qatar has made a $2 billion investment in a steel plant in eastern Algeria, for example, and has cooperated with Algiers to secure a reduced production agreement from the Organization of the Petroleum Exporting Countries (OPEC). Likewise, Algeria’s reluctance to oppose Bashar al-Assad in Syria, its refusal to designate Hezbollah or Hamas as terrorist organizations, and its abstention from the Saudi-led coalition in Yemen have shown to Qatar that it can build on its partnership with Algeria to prompt the leading gas exporter to use its independent foreign policy and strategic leverage to stand up to Riyadh’s and Abu Dhabi’s agenda in the Gulf. This could prompt Rabat to increase its ties to Saudi Arabia in an attempt to counter Algiers.

Even Morocco—perceived as the Maghreb state with the closest relations with the Gulf states—has taken a neutral stance on both Libya and Qatar, for once appearing to converge with Algeria, its neighbor and arch-competitor. And while Algeria’s desire for a mediated solution in Libya is a national priority given security concerns along its 982-kilometer (610-mile) border with Libya, Morocco’s default support for mediation—which successfully led to the Skhirat Agreement in 2015 to establish a unity government in Libya—is more flexible, as it is based more upon a desire for regional status than out of national security concerns. Like Algeria, Tunisia has a security interest in resolving the Libyan conflict, but has been less neutral on the Gulf crisis. It enjoyed friendly ties with Qatar even as its relations with the UAE—its second-largest trading partner after Libya—worsened over the UAE’s attempt to interfere in Tunisian internal politics to curb political Islam and the influence of the Ennahda Party. And owing to Morocco’s support for Saudi policies regarding Iran and military intervention in Yemen, Rabat also does not have the same ability as Algiers to remain neutral regarding the diplomatic and economic embargo on Qatar—even though it would prefer to be able to keep receiving Doha’s investment and financial assistance.

Saudi Arabia strengthened its ties with Morocco, pledging $100 million in December to support the French- and Moroccan-backed Group of Five Sahel (G5 Sahel) Joint Force, comprised of 5,000 troops from Sahel states that aim to combat armed groups and stem illegal migration. This not only expands Riyadh’s engagement in North Africa but also brings Moroccan and Saudi interests closer and further sidesteps Algeria, which has stayed out of the G5 Sahel out of rivalry with Morocco. The Saudi support—and the potential arms sales with France that may follow from its increased engagement in the Maghreb—may also be an attempt to improve relations with Paris, which it hopes could replace London as Riyadh’s trusted channel in the European Union once the United Kingdom withdraws.

Meanwhile, Qatar’s rift with Bahrain, Saudi Arabia, and the UAE may have confirmed other Gulf states’ suspicion that Qatar is ready to ditch the GCC’s collective security commitment to pursue its own regional policy—even though their own actions have left Qatar no other option. In practice, the blockade of Qatar even paralyzed the GCC summit in early December, thereby further eroding the council’s claim to be the main regional security forum and bulwark for Iran’s containment.

In this context, however the crisis ends, it will likely impact Maghreb approaches to the Gulf in turn, as Algiers and Rabat will seek to capitalize on their preferred Gulf partners’ ambitions in North Africa to further their own interests in the Gulf region. To address the transnational and cross-regional concerns that have supplanted geostrategic approaches to Gulf–Maghreb relations, both sub-regions would benefit from leaving transactional diplomacy behind and embracing a more mature and transparent strategic and security dialogue.

Jacques Roussellier teaches international relations at American Military University and is co-editor of Perspectives on Western Sahara: Myths, Nationalism and Geopolitics (Rowman & Littlefield: New York, 2014).