What you need to know:
- Farmajo's four-year mandate expired in February, but was extended by parliament in April, triggering deadly gun battles in the capital Mogadishu, with some rivals viewing it as a flagrant power grab.
Somalia's long-delayed elections will proceed "as planned", Prime Minister Mohamed Hussein Roble told visiting UN diplomats on Sunday, even as a damaging feud between him and the country's president sparked fresh fears for the troubled Horn of Africa Nation.
The very public spat between Roble and President Mohamed Abdullahi Mohamed, better known as Farmajo, comes as Somalia struggles to organise polls that are months behind schedule and keep an Islamist insurgency at bay.
As senior politicians made frantic efforts to defuse tensions and end the impasse, Roble told a delegation led by United Nations Deputy Secretary General Amina Mohammed that the vote would go ahead as planned.
The increasingly bitter row has threatened to throw an already fragile electoral process into deeper peril.
Farmajo's four-year mandate expired in February, but was extended by parliament in April, triggering deadly gun battles in the capital Mogadishu, with some rivals viewing it as a flagrant power grab.
Roble cobbled together a new timetable for polls, but the process fell behind, and on Wednesday he accused Farmajo of trying to reclaim "election and security responsibilities" from him.
On Sunday, as Roble sought to reassure UN diplomats about the vote, his office released a statement saying: "We are committed to hold the elections as planned, and other existing matters will not have any effect on the elections."
"The prime minister informed the delegation about the achievements made towards (holding) the election... and how he is committed to (holding) elections that are peaceful and transparent," the statement said.
Elections in Somalia follow a complex indirect model, whereby state legislatures and clan delegates pick lawmakers for the national parliament, who in turn choose the president.
The next phase is scheduled for between October 1 and November 25.
The row erupted last week when Roble sacked Somalia's intelligence chief over his handling of a high-profile probe into the disappearance of a young agent.
Farmajo overruled the prime minister, appointing the dumped intelligence official as his national security adviser.
Roble in turn accused the president of "obstructing" the investigation, and in a late-night move on Wednesday, fired the security minister and replaced him with a Farmajo critic.
The spat has raised the political temperature in Mogadishu, with a coalition of opposition presidential candidates on Friday saying it "supports the prime minister... and condemns the actions of the outgoing president".
The UN Assistance Mission in Somalia last week urged both leaders to stop bickering and focus on the elections.
Analysts say Somalia's political crises have distracted from more pressing threats, most notably the violent Al-Shabaab insurgency.
The Al-Qaeda allies were driven out of Mogadishu a decade ago but retain control of swathes of countryside and continue to stage deadly attacks.