Somalia's President Mohamed Abdullahi Mohamed on Saturday relaunched talks over the holding of fresh elections, in a move welcomed by the opposition following the country's worst political crisis in years.
In a brief speech before parliament that was broadcast live, Farmajo, as the president is nicknamed, effectively abandoned a policy voted through last month that would have extended his term in office by two years.
He asked his prime minister to take charge of organising fresh elections -- a key demand of the opposition.
"We have decided to seek a solution through negotiations and to avoid starting violence in the benefit of those who trade on the blood of the public," he said.
Deadly clashes broke out this week between armed rivals in the capital Mogadishu over Farmajo's failure to hold elections before his term ended in February, due to the collapse of a deal between him and state leaders over the terms of the vote.
The city has been on a knife's edge since the political crisis erupted into gunfire last Sunday between rival factions of the security forces backing Farmajo and the opposition, leaving three people dead.
The international community has repeatedly called for elections to go ahead, threatening sanctions against the nation of 15 million, which is divided into five semi-autonomous states.
In his speech Farmajo returned to the agreement reached with states in September to hold indirect elections, whereby special delegates chosen by Somalia's clan elders would pick lawmakers who in turn choose the president.
"I want to make clear that Prime Minister Mohamed Hussein Roble will lead in preparing and implementing the election and the security of the election," he said.
"I ask the government to get ready for the huge task."
The measure was voted through unanimously by the 140 members of parliament present.
Roble told an evening press briefing: "Today is a historic day with particular importance for the Somalia peace process, democracy and governance.
"We are committed to holding fair, free and inclusive elections without anyone having their rights deprived," the prime minister said. "I will very soon invite all the concerned parties to a meeting."
- 'Step forward' -
The president had already sought to ease tensions earlier in the week with an address to the nation calling for "urgent discussions" with his political opponents.
A coalition of opposition candidates welcomed the latest developments on Saturday, calling them "a step forward".
"I applaud the decision of the parliament to get back to the implementation of the September 17 agreement," said coalition chief and former Somali president Sharif Sheik Ahmed, describing the deal as "the only solution we have for elections".
Turkey, a key partner in the Somali government, also hailed the move, saying it hoped for "constructive talks among political stakeholders without delay".
The September agreement had collapsed as Farmajo and the leaders of two states, Puntland and Jubaland, squabbled over the terms. Multiple rounds of UN-backed talks failed to bridge the impasse.
Farmajo's election in 2017 was greeted by widespread hope among Somalis, who saw him as a leader determined to fight corruption as well as Al-Shabaab, the Al-Qaeda-linked militants who control swathes of territory.
The president has adopted a strong nationalist stance, to the point of breaking off diplomatic relations with Kenya -- an approach that has earned him support from some Somalis, although he has also made plenty of enemies.
A supporter of a strong central state, Farmajo has been accused of meddling in several state elections by attempting to place his allies in power there.
His opponents had regarded the extension of his mandate as a flagrant attempt to stay in power.
Al-Shabaab, meanwhile, have not seen their position particularly weakened during Farmajo's time in office.
The Mogadishu government controls only a fraction of Somali territory, with the support of some 20,000 troops from the African Union force Amisom.