By the end of Sunday, Somalis should know who their next president will be, but the long-delayed vote involved only the country’s 329 MPs and took place in a heavily guarded area.
The unusual situation highlights Somalia’s security concerns and lack of democratic accountability.
The winner of a record 39 candidates will also have to deal with the effects of the ongoing drought.
But the biggest task is to wrest control of much of Somalia from al-Shabaab.
The al-Qaeda-linked Islamist militant group continues to control much of the country, with frequent attacks in the capital Mogadishu and elsewhere.
The federal government is backed by the African Union (about 18,000 soldiers) and the United Nations in its fight against al-Shabaab.
No one-person, one-vote democratic election has been held in Somalia since 1969.
That vote was followed by coups, dictatorships and clashes involving tribal militias and Islamic extremists.
Instability is one reason why Somalia cannot hold direct elections.
This is only the third indirect election of a president to be held on Somali soil. Previous meetings have been held in neighbouring Kenya and Djibouti.
Who is running for president?
Among the 39 candidates are current President Mohammad Abdullah “Famajo”, two former presidents Sharif Sheikh Ahmed and Hassan Sheikh Mohammed, and former Prime Minister Hassan Ali Kyle.
The four, along with the president of Somalia’s Puntland region, Syed Abdullahi Deni, are considered frontrunners.
Their manifesto focused on political stability, improved security and economic reform.
Former foreign minister Fazia Youssef Adam is the only woman among those who want the top job.
How will the voting work?
The vote was supposed to come at the end of Mr. Farmagio’s four-year term last year. But political divisions and instability delayed the vote, and the president remained in power.
The members of Congress who will choose the next president on Sunday are themselves elected by representatives nominated by the country’s powerful clans.
They will gather in a large airport hangar at the heavily fortified Harlan camp. This is the main military base of the African Union Mission in Somalia (Artemis) and is also home to diplomatic missions and aid agencies.
Voting will be by secret ballot, with several rounds expected before one candidate emerges as the winner.
Those who drop out in each round may be able to act as kingmakers, urging their supporters to support another candidate.
Past elections have been marred by alleged vote buying, with candidates reportedly offering funds in exchange for support.
What did al-Shabaab say?
In previous elections, al-Shabaab threatened or even kidnapped tribal elders after accusing them of taking part in what it deemed un-Islamic polls.
This time, it has responded more modestly to the election, fearing that its members or sympathizers could covertly seek parliamentary seats to undermine the system from within.
Neighboring Djibouti President Omar Guelleh publicly expressed this fear in 2020, when he was quoted as saying: “I fear we will end up with a parliament indirectly controlled by al-Shabaab Because they will have the support of some members of Congress. “
Some analysts believe that Mr Guelleh has exaggerated the chances of al-Shabaab gaining a foothold in parliament, but there is no doubt that it is a major political force in Somalia.
What challenges does the next president face?
In addition to the ongoing threat from al-Shabaab and the need to expel the militants in some way, Somalia is suffering from a drought that has hit countries in the region.
It has sparked a humanitarian crisis in which 3.5 million Somalis are at risk of severe famine, according to the United Nations. Herdsmen who have lost their cattle are heading into towns to find a way to survive.
The country is also suffering from food and fuel inflation caused by the war in Ukraine.
There is pressure to complete the constitutional process and secure democratic elections in the country over the next four years.
However, Somalia’s power brokers long ago agreed to hold single-vote elections this year, but failed to deliver on that promise.