Somalia's president and prime minister say they have struck a deal to speed up the process for long-delayed elections, ending a simmering feud that threatened to plunge the Horn of Africa nation into fresh crisis.
The two men had locked horns over top security appointments and dismissals in a month-long dispute that stoked fears for Somalia's stability, distracting from efforts to confront a long-running Islamist insurgency.
But in a joint statement released late Thursday, President Mohamed Abdullahi Mohamed and Prime Minister Mohamed Hussein Roble said they had "agreed to accelerate the election process by calling on the federal member states to start the election of the (lower house of) parliament in the next couple of weeks".
The pair's bitter power struggle became public in September when Roble sacked Somalia's spy chief over his handling of a high-profile probe into the disappearance of a young intelligence agent.
The president, known as Farmajo, overruled the premier, appointing the sacked spymaster as his national security adviser, and announced that he was withdrawing Roble's executive powers until the election process was completed.
Roble in turn accused Farmajo of seeking to sabotage the government's functioning.
On Thursday, the two men said they would stop bickering over the appointments and support a judicial investigation into the disappearance of agent Ikran Tahlil, whose family has accused her employers at the National Intelligence and Security Agency of murdering her.
"The leadership have agreed to let the judiciary agencies take charge of the case of Ikran Tahliil and instructed security agencies to help the justice system in the investigations," the statement said.
The president of Somalia's Southwest state, who led mediation efforts to end the spat, welcomed the news.
"I thank both the president and the prime minister for their compromises and showing responsibility... Tonight, the conflict is over and peace will prevail for the country to hold elections", Abdiaziz Hassan Mohamed said in a speech Thursday night.
Somalia has been struggling to hold elections for months.
Farmajo's four-year mandate expired in February, but was extended by parliament in April, triggering deadly gun battles in Mogadishu, with some rivals viewing it as a flagrant power grab.
Roble cobbled together a new timetable for a vote, but the process has fallen behind schedule, and last month he accused Farmajo of trying to derail it.
Elections for the lower house of parliament were due to take place October 1-November 25 but voting has yet to start because the upper house elections in some states have not yet been completed.
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.
Analysts say the impasse has distracted from Somalia's larger problems, notably the 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 in the capital and elsewhere.