What to know about Somalia's latest political crisis
Somalia is no stranger to crisis: overrun by Islamist insurgents, desperately short on food, and plagued by climate extremes, the fragile state faces many considerable challenges.
But a bitter dispute over elections has thrust the Horn of Africa nation into a dangerous new phase, with the president accused of refusing to leave office as tensions with his political foes reach breaking point.
What is happening?
Somalia's President Mohamed Abdullahi Mohamed, better known by his nickname Farmaajo, on Tuesday signed into law a parliamentary bill extending his mandate for two years.
The bill bypassed the Senate, after being adopted by the lower house of parliament earlier this week, and the move has been decried as an unconstitutional bid to cling to power.
Farmaajo's legal authority had been in doubt since February, when his four-year term expired before fresh presidential elections were held.
Opposition parties had already declared they no longer recognised him.
The decision to extend his mandate sets Farmaajo on a collision course with influential armed rivals and the Western powers that prop up his weak administration.
"This is uncharted territory," said Hussein Sheikh-Ali, chairman of the Mogadishu-based Hiraal Institute think tank, and a former national security adviser to Farmaajo's government.
"Somalia is on the brink of total collapse once again, I have no doubt."
How did we get here?
The crisis mushroomed from a long-simmering disagreement between Farmaajo and the leaders of Puntland and Jubaland, two of Somalia's five semi-autonomous states, over how to conduct elections.
A deal was cobbled together in September paving the way for indirect elections in late 2020 and early 2021, whereby special delegates chosen by Somalia's myriad clan elders pick lawmakers, who in turn choose the president.
But that agreement collapsed as the parties accused each other of reneging on promises and refusing to compromise.
Multiple rounds of talks failed to salvage the September accord, and deadlines for the election came and went.
Members of Somalia's political elite have reached consensus in past electoral cycles despite historic rivalries and vastly divergent agendas, said Murithi Mutiga from the International Crisis Group (ICG).
"But this is a new, more dangerous phase," the ICG's project director for the Horn of Africa said.
"The level of trust between the parties is so low that it's hard to conceive a situation where they will compromise."
The new law signed by Farmaajo promises the country's first one-person, one-vote election in more than half a century.
Is there a risk of violence?
Farmaajo's rivals in Puntland and Jubaland have formed an alliance with a powerful coalition of presidential aspirants and other opposition heavyweights in Mogadishu.
They include two former presidents and the Speaker of the Senate, whose chamber was denied the opportunity to review the mandate extension before its signing into law, and declared it null and void.
The have warned that ruling by decree risks peace and stability in Somalia -- a loaded threat given Jubaland and Somali forces have clashed on the battlefield, and some of Farmaajo's enemies command clan militias.
There have already been some high-profile defections. Mogadishu's police chief was fired after trying to shut down parliament ahead of the mandate vote, declaring it a theft of power in an extraordinary public address.
Analysts fear a splintering of Somalia's security forces along political and clan lines, and the risk of deadly street-to-street combat in Mogadishu should the crisis fester.
"It's not going to be a couple of hours of shootout and things go back to normal," said Sheikh-Ali.
How will the world react?
The United Nations had warned for months that any further delay to elections or extension or prior mandates would not be tolerated by the international community that keeps Somalia financially afloat.
"But now in broad daylight, the Somali parliament and Farmaajo have defied that, despite all the bad consequences that comes with it," Abdimalik Abdullahi, an independent Somalia analyst, told AFP.
Secretary of State Antony Blinken warned the US was considering "all available tools" including sanctions against its long-standing partner in the war on terror.
The EU, too, spoke of "concrete measures" should talks between the squabbling parties not resume.
But Farmaajo counts on support from Qatar and Turkey and regional allies Eritrea and Ethiopia, analysts said, while exploiting divisions within the West over how to handle the recalcitrant administration.
"One has to question how determined and coherent the international pressure on him might be," Mutiga said.
What about Al-Shabaab?
The crisis meanwhile plays straight into the hands of Al-Shabaab, the insurgents who control swathes of Somalia and are bent on overthrowing the government in Mogadishu and imposing strict Islamic law.
The Al-Qaeda-linked militants have released propaganda videos in recent weeks that seize on the political chaos, casting the country's elite as power hungry and unfit to govern.
The internal squabbling gives Al-Shabaab an opening to exploit divisions in the armed forces and further its violent agenda, Mutiga said.
"This is a gift for Al-Shabaab," he said.