Fighting has erupted in the Somali capital Mogadishu, with rising tensions between the president and a host of powerful opponents spilling over in the fragile country's worst political violence in years.
The clashes came after President Mohamed Abdullahi Mohamed failed to hold scheduled elections and instead extended his mandate by two years, thrusting the long-troubled Horn of Africa nation into a fresh crisis.
What is happening?
Armed men and vehicles mounted with machine guns have taken up positions in opposition strongholds after a night of gunfire in the capital, after government troops clashed with fighters allied to the president's rivals.
At daybreak, the sporadic bursts of gunfire had eased but sandbags and logs blocked roads to tense neighbourhoods, and some residents prepared to flee ahead of a feared return to violence.
It was not immediately clear which forces had exchanged fire. President Mohamed, better known by his nickname Farmajo, faces an array of foes and some are capable of mobilising well-equipped militias loyal to clan ties.
Somalia's previous president Hassan Sheik Mohamud claimed forces loyal to Farmajo attacked his residence in Mogadishu. The government denied this, saying government troops repelled several assaults by "organised militia who entered the capital".
Some schools and universities were closed while in other parts of the city life proceeded much as usual.
How did we get here?
The political temperature in Mogadishu, one of the few parts of Somalia under central government control, has been climbing since February when Farmajo's four-year term lapsed before fresh elections were held.
His opponents accused Farmajo of refusing to leave office, and organised street protests against his continued rule that ended in gunfire and chaos.
As tensions escalated, Farmajo earlier this month signed into law a contentious measure extending his mandate and promised elections within two years.
The move was declared unconstitutional by Farmajo's rivals, and rejected by Somalia's western backers, who urged him to return to the negotiation table and threatened sanctions if he did not comply.
The crisis mushroomed from a long-simmering disagreement between Farmajo 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 by February but that agreement collapsed, and multiple rounds of UN-backed talks failed to broker a way forward.
Who are the parties involved?
Farmajo'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.
They had 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 Farmajo's enemies command clan militias.
Analysts fear a splintering of Somalia's security forces along political and clan lines, and had warned Mogadishu could be the scene of street-to-street battles.
How has the world reacted?
The British embassy and European Union envoy in Mogadishu expressed alarm over the latest violence, while the United Nations Mission in Somalia (UNSOM) urged "calm and maximum restraint by all parties".
"Violence is not the solution to the current political stalemate. We urgently call on all parties to resume immediate dialogue," UNSOM posted on Twitter.
But Farmajo counts on support from Qatar and Turkey and regional allies Eritrea and Ethiopia, analysts say, while exploiting divisions within the West over how to handle the recalcitrant administration.
The UN 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.
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, said Murithi Mutiga from the International Crisis Group (ICG) think tank.
"This is a gift for Al-Shabaab," the ICG's project director for the Horn of Africa told AFP.