President Farmaajo withstood significant pressure in staying out of Saudi Arabia's feud with Qatar. But it may pay a cost for its neutrality.
Six months since President Mohamed Abdullahi Mohamed took office, Somalia is at the centre of an international and domestic political storm.
This June, the president known as "Farmaajo" was under pressure to cut ties with Qatar in solidarity with Saudi Arabia, the United Arab Emirates, Bahrain and Egypt. Those four countries - along with a few others that followed suit - had suddenly severed relations with Qatar, accusing it of backing Islamist militants.
Somalia was encouraged to join this boycott, but to the surprise of some, Farmaajo decided instead to maintain a neutral stance. His administration called on "all the brotherly countries involved to settle the differences through dialogue".
This was seen as a particular blow to Saudi Arabia and the UAE, two highly influential powers in the Middle East and in Somalia specifically. It also lessened the pressure on Qatar. For example, by continuing to allow the country's planes to fly through Somali airspace, the impact of an air blockade was weakened, irritating Qatar's opponents.
Why stay neutral?
Saudi Arabia is Somalia's biggest trading partner and, following his election this February, President Farmajo's first foreign trip was to Riyadh. With such close links, Mogadishu tends to align with the Kingdom.
In January 2016, for instance, Somalia severed ties with Saudi Arabia's nemesis Iran as the regional powers' rivalry heated up; on the same day, Mogadishu received a $50 million aid pledge from Riyadh. In Yemen's civil war, Mogadishu backs the Saudi-UAE coalition against the Iran-supported Houthis. And in 2015, the government even sided with Saudi Arabia against Sweden after the major European donor criticised the Middle Eastern country's human rights record.
This time though, Somalia decided not to offer unwavering support for the Kingdom, despite reportedly being offered $80 million to do so. This may be for a number of reasons. One could be Farmaajo's close relations with Doha via his newly-appointed chief-of-staff and former Aljazeera Arabic journalist Fahad Yasin. Qatar reportedly backed former president Hassan Sheikh Mohamud's election in 2012, before opting to support and finance Farmaajo's campaign in 2016/17.
Somalia's approach to the Qatari crisis may also derive from its displeasure with the UAE, which has recently deepened relations with the two autonomous regions of Somaliland and Puntland. Mogadishu has accused the UAE of undermining Somali national integrity and of bypassing central government by agreeing to take over the ports in Berbera and Bosaso. Farmaajo raised his frustrations with leaders in both Abu Dhabi and Riyadh earlier this year, but seemingly to little avail.
Pressure from within
Regardless of the reasons for maintaining neutrality, Farmaajo faces significant pressure from within Somalia to reverse his neutral stance .
Three heavyweight politicians in particular have come out strongly. Omar Abdirashid Sharmarke, the only Somali politician to have served as prime minster twice, was reportedly the UAE's favoured candidate in the 2017 elections. Abdulqadir Osoble, chair of the foreign affairs committee in Parliament, is a businessman sympathetic to Saudi Arabia. And Abdirazaq Osman Hasan "Jurile", chair of the Senate committee on foreign affairs, hails from Bosaso, where the Dubai-owned P&O ports is investing $336 million. All three have spoken out against Farmaajo's unwillingness to back the anti-Qatari alliance.
Many regional governments are also likely opposed to the government's position. Somaliland and Puntland get significant development assistance from the UAE. Jubaland's regional security forces are equipped and paid by the Emiratis. And South West state is currently negotiating with Dubai's P&O ports over a deal in Barawe.
This regional support for the Saudi-UAE block could be expressed by the regions' representatives in federal parliament. It is also possible that those from the two remaining regional states, Galmudug and Hirshabelle, will also follow suit.
In these often complex regional dynamics, Mogadishu is watching Somaliland particularly closely. This region has consistently demanded full recognition of its self-declared independence since 1991, and its closer ties with Riyadh and Abu Dhabi could give the region fresh hope in this bid, especially if it sees Mogadishu alienating itself from these influential powers.
Important economic partners
The greatest pressure for Somalia to change its stance, however, probably comes from Saudi Arabia and the UAE themselves. Their financial support is crucial to the country, especially with the resources of the European Union, Somalia's largest donor, strained by other global crises.
The UAE has been involved in training, equipping and paying salaries for soldiers in the Somali National Army. Saudi Arabia has provided significant budgetary support to the government, as the Kingdom's Foreign Minister reminded Somalia's PM in Addis Ababa last month. Saudi Arabia and the UAE are jointly responsible for importing 80% of Somalia's livestock exports. And the two could feasibly jeopardise Somalia's efforts to get crucial debt relief from various Arab states.
Saudi Arabia and its allies may also be able to exploit Somalia's domestic political tensions for its own ends. In Somalia, there have been recent disputes between lawmakers and the judiciary as well as between the Prime Minister and his Interior Minister. Others, meanwhile, are aggrieved by what they see as politically-motivated prosecutions and the cancellations of private contracts, allegedly to favour companies linked to the new leaders.
Holding the balance
President Farmaajo is clearly in a very tough spot, with a vast array of contradicting interests to contend with and limited options. It will take his best diplomatic manoeuvring to navigate this crisis.
Saudi Arabia and the UAE have huge amounts of political and economic leverage, but Somalia should remind them that it still provides important support to them in their efforts in Yemen and against Iran. Somalia could also use the impasse as an opportunity to push harder in discussions regarding UAE's relationships with Somalia's regional governments.
Qatar may be grateful for Somalia's neutrality thus far, but Doha should also be made aware of the difficulties of maintaining this approach for the poor and troubled nation. It may be possible to discuss parallel channels whereby relations with Qatar can be continued, though not at the cost of Somalia's political and economic interests with Saudi Arabia.
Above all though, the federal government will have to put its own house in order. It will have to engage with opportunistic politicians and brokers that are currently pushing foreign interests. It will have to reassure regional governments such as Puntland and Somaliland that its stance will not be detrimental to their interests to keep them on side. And it will have to demonstrate to parliamentarians that its reluctance to break ties with Qatar is not simply because it allegedly funded the president's election campaign.
There is no doubt that Farmaajo is in a tight corner, and he will not be able to please everyone. However, if he is able to maintain channels of communication with all the various interested parties, he may be able to decrease or at least delay the potentially severe repercussions of opting not to fall into line with Saudi Arabia.