Though the Qatar crisis is geographically removed from Morocco, it has caused consternation in the North African monarchy, a close ally of the Gulf states. No sooner had Saudi Arabia denounced Qatar than other Arab allies followed, including the United Arab Emirates, Jordan, Bahrain, and Egypt. The notable exception was Morocco, which chose to remain neutral.

Morocco is in the difficult position of having to choose among friends, particularly in a crisis it regards as unnecessary. The situation has only become more complicated after Qatar’s rejection of conditions set by the Saudis, Emiratis, Egyptians, and Bahrainis on July 5. Although the monarchy and those close to it would argue that Morocco’s position shows wisdom and underlines how good Rabat’s relations are across the Gulf, it also speaks to the pressures it would face if it picked a side.

So far Morocco seems to be hedging its bets, eager to figure out a way of holding on to all its partners. If it can maintain ties with Qatar without angering Saudi Arabia and the UAE, not only would it be true to its cherished relationships with the Gulf Cooperation Council, it could also enhance Rabat’s foreign policy credibility. But now that the crisis appears to be worsening, that balance may be less and less tenable.

On June 11, the Moroccan Foreign Ministry issued a brief statement affirming the country’s strong relations with all Gulf states, based on “the strong personal bonds, sincere brotherhood, and the mutual appreciation between His Majesty Mohammed VI and his brothers the kings and princes of the Gulf Cooperation Council …” The statement also highlighted the king’s call for restraint and affirmed that the kingdom would not take positions that “kindle differences and deepen divides.” It affirmed Morocco’s willingness to mediate between the conflicting parties, and was followed by another on June 12 reminding Gulf countries of Morocco’s commitment to them and support for their various regional endeavors.

Indeed, Morocco has always been a faithful partner of the Gulf countries, in particular Saudi Arabia and the UAE. In return, these countries have invested heavily in the kingdom. Morocco was even briefly considered as a possible member of the Gulf Cooperation Council (GCC) during the regional tumult of 2011. Although this came to nothing, economic and political ties with Saudi Arabia and the rest of the GCC continued to flourish.

The younger generations of Gulf leaders—including Abu Dhabi’s Crown Prince Mohammed bin Zayed and Saudi Arabia’s recently elevated Crown Prince Mohammed bin Salman—are said to be close to King Mohammed VI. The king indicated in an April 2016 speech in Riyadh that Mohammed bin Zayed even participated in the Green March of November 1975, when Morocco gained control of the Western Sahara ahead of the Spanish withdrawal. In 2015, Mohammed bin Zayed was granted the Order of Mohammed, the highest royal medal in Morocco, for advancing UAE-Morocco relations—the strength of which has been celebrated by both countries.

Among the stronger indications of the Moroccan monarchy’s commitment to Saudi Arabia was its willingness to join the war in Yemen. Morocco contributed six F-16 aircraft to the military campaign and participated in attacks on the Houthis. Before that, it had participated in the coalition against the so-called Islamic State. Morocco’s engagement in Yemen was aimed at reassuring Saudi Arabia of its commitment, but not at too heavy a cost. Though the government played down this limited engagement, the death of a Moroccan pilot who went down over Saada in 2015 prompted a brief, albeit interesting, internal debate in Morocco about the wisdom of joining in a far-removed war against an enemy that had never harmed the kingdom.

Though Morocco is a long-time close friend of Saudi Arabia, to which it is bound by strong economic, political, and even distant familial bonds between members of the royal families, its unwillingness to take sides in the Qatar dispute is a testament to Rabat’s growing ties with Doha as well. Morocco’s relationship with Qatar may not be as expansive as the one with Saudi Arabia, but it has grown in recent years and is anchored in strong economic cooperation.

Since 2011, the number of bilateral cooperation agreements and memorandums of understanding has increased substantially, and Qatar is emerging as a major investor in Morocco. Although Saudi Arabia and the UAE remain among the top investors, in 2016 Qatar ranked fifth in terms of net inflows of foreign direct investment. That said, Morocco had shown its displeasure with Al-Jazeera’s coverage of a number of issues related to Morocco, namely the Western Sahara. The Ministry of Communications temporarily shut down Al-Jazeera’s office in 2010 and revoked its press accreditations, a tactic it had used against some of its reporters before. However, this did not lead to greater tensions with Qatar.

While the growing economic ties have played a role in Morocco’s reluctance to denounce Qatar, overall it appears that Rabat does not see an upside in shunning Doha the way other countries have. While maintaining its neutrality, the Moroccan government still sent a shipment of food to address the shortages Qatar faced after the Saudi-led boycott began, which was explained away as “Ramadan charity.” At the same time, Moroccan Foreign Minister Nasser Bourita was shuttling between Gulf countries—namely Saudi Arabia, the UAE, Qatar, and Kuwait—in pursuit of a mediation role.

As the stalemate over Qatar’s acceptance of Arab conditions continues, Morocco is quite unlikely to take a stand that would jeopardize its ties with Saudi Arabia. Even its decision to ship food to Qatar was likely the outcome of careful calibration and study. There has been some speculation recently that Saudi Arabia is putting pressure on Morocco to take a stand and has shown its displeasure by subtly provoking Rabat over the Western Sahara—a critical issue for Morocco—in the media. These speculations derived from what was possibly an over-interpretation of a program, Al-Hadath, on the Western Sahara that was broadcast on the Saudi-owned Al-Arabiya station. The program, while hardly antagonistic toward Morocco’s claims, did refer to the territories as “Western Sahara” not “Moroccan Sahara,” the term used in Morocco. It also named the Sahrawi Arab Democratic Republic in quotes, and indicated that the latter referred to Morocco as an occupying force.

Another program, that aired on Abu Dhabi TV, while praising Morocco’s religious and cultural tolerance, showed a map of the kingdom without the Western Sahara. This was also highlighted as further indication of the UAE’s discontent with Morocco.

However, such readings overlook the fact that Saudi Arabia’s vast economic and political leverage over Morocco means that it would not need to resort to indirect or subtle messaging, or such strained displays of displeasure, to ensure Morocco’s support. For Rabat, Saudi Arabia is a more valuable strategic ally than Qatar. Should Riyadh demand Morocco’s cooperation, the latter will likely grant it.