Somali leaders had failed several times in the past six months to strike a deal to hold elections, with lawmakers voting last month to extend President Mohamed Abdullahi Mohamed's term in office for two years.
Somali lawmakers have voted unanimously to cancel a two-year presidential term extension they had approved last month, after clashes in the capital Mogadishu between factions of the security forces, which are divided over the issue.
In a speech following the vote in the lower house of parliament on Saturday, Prime Minister Mohamed Hussein Roble ordered the army to return to barracks and urged politicians to avoid inciting violence.
The political crisis has raised fears that al Qaeda-linked al Shabaab insurgents could exploit a security vacuum if state forces split along clan lines and turn on each other.
The group has taken over at least one Somali town in the past week as heavily armed fighters moved from the countryside into the capital city.
Mohamed's term expired in February
President Mohamed Abdullahi Mohamed's attempt to extend his term has also angered foreign donors, who have backed his government in an attempt to bring stability to Somalia after more than two decades as a failed state following a civil war that began in 1991.
Saturday's lower house vote was broadcast on Somali television and came shortly after Mohamed addressed parliament and said he was directing the prime minister to prepare to hold a delayed parliamentary election.
Roble said in a Twitter post late on Saturday that the government will "soon" prepare the plan for elections, and thanked the president and the parliament.
READ MORE: What’s happening in Somalia?
Cognizant of the Federal Member States role, I urge them to work with us to ensure free & fair elections takes places in the country. I will soon invite them to attend the National Consultative Forum to finalize the electoral process in line with the Sept 17 and Feb 16 Pacts.— Mohamed Hussein Roble (@MohamedHRoble) May 1, 2021
Mohamed's term expired in February, but without a new crop of lawmakers, parliament was unable to choose a president.
The term extension was approved by the lower house last month but rejected by the Senate, provoking the crisis that has intensified in the past week.
Between 60,000 and 100,000 people were forced to flee their homes following clashes on Sunday that stirred fears of all-out war between heavily armed factions for and against the president.
Rashid Abdi, a Nairobi-based independent analyst, said the parliamentary vote and the president's move towards holding elections appeared to be a good compromise.
"The problem is there is so little trust between the parties and as long as Farmaajo holds the levers of the military and security services, it looks difficult to build confidence in that process," he said, using a popular nickname for the president.
The US State Department, the EU ambassador, and the Turkish Foreign Ministry praised Saturday's developments.
"We call on the parties to the agreement to meet immediately without preconditions to finalise electoral arrangements and begin implementation in a collaborative and transparent manner," State Department spokesman Ned Price said in a statement, adding that the United States stood ready to support the conduct of elections as soon as possible.
Turkish government welcomes the decision of the Lower House of the #Somalia Parliament today (1 May), which endorses holding the elections on the basis of the 17 September agreement as soon as possible. pic.twitter.com/zbvvVZKoWM— Khaalid Foodhaadhi (@KFoodhaadhi) May 1, 2021
Battle lines drawn
Opposition lawmaker Abdirahman Odowaa told Reuters "much remains to be done", adding that he wanted Mohamed to formalise what had been agreed.
"The handing over of security and election process to the prime minister should be documented and signed ... (He) has to go to the conference tent and sign ... before all," Odowaa said.
Senator Ilyas Ali Hassan, from another opposition party, Himilo Qaran, said he hoped Roble "will now lead the election and ... do the right thing, so that this country can have a free and fair election".
Abdulahi Ali Hirsi Timaade, information minister of Puntland, one of Somalia's five regional governments, told Reuters he wanted Mohamed to confirm in a letter that he had given Roble responsibility for the elections and security.
Mogadishu shopkeeper Duale Hussein said he feared the opposition had been duped.
"He cleverly did a somersault," Hussein said of the president. "Farmaajo still rules everything ... Roble is just his remote control."
It was not immediately clear whether security forces loyal to the opposition would withdraw from fortified positions in the capital following Saturday's vote and Roble's order, having refused to do so earlier this week.
Somalia's armed forces include members of clan militias who have often battled each other for power and resources.
Mohamed is Darod, one of Somalia's major clans. Most of the opposition leaders and Somali military in the capital are Hawiye, another large clan.