By the end of Sunday, Somalis should know who their next president is, but this long-delayed vote only involves the country's 329 MPs and takes place in a heavily fortified area.
The unusual circumstances highlight Somalia's security issues, as well as the lack of democratic accountability.
The capital, Mogadishu, is in total lockdown until Monday morning.
The MPs have started to cast their ballots in what is expected to be a closely fought contest.
The winner among the record 35 candidates will also have to deal with the impact of the ongoing drought.
But the big task is to wrest control of much of Somalia from al-Shabab.
The al-Qaeda-linked Islamist militant group continues to dominate large parts of the country and carries out frequent attacks in Mogadishu, and elsewhere.
The federal government is backed in its fight against al-Shabab by the African Union, in the shape of some 18,000 troops, and the United Nations.
Somalia has not had a one-person-one-vote democratic election since 1969.
That vote was followed by a coup, dictatorship and conflict involving clan militias and Islamist extremists.
The instability is one of the reasons why Somalia has been unable to hold direct elections.
This is only the third time that the indirect election for president has been able to take place in Somalia itself. Previous ones were held in neighbouring Kenya and Djibouti.
Who is running for president?
Four candidates dropped out at the last minute, leaving 35 still in the race.
They include current President, Mohamed Abdullahi "Farmajo", two former presidents, Sharif Sheikh Ahmed and Hassan Sheikh Mohamud, and a former prime minister, Hassan Ali Kheyre.
These four, along with the President of Somalia's Puntland region, Sa'id Abdullahi Deni, are considered to be the frontrunners.
Their manifestos focused on political stability, improving security and economic reforms.
Fawzia Yusuf Adam, a former foreign minister, is the only woman among those who want the top job.
How will the vote take place?
This vote was supposed to have happened last year when Mr Farmajo's four-year term ended. But political differences and instability delayed the poll and the president remained in power.
The MPs who are choosing the next president were themselves elected by delegates nominated by the country's powerful clans.
They are gathered in a large airport hangar in the well-guarded Halane Camp. This is the main military base of the AU's mission in Somalia (Atmis), as well as the home of diplomatic missions and aid agencies.
Voting is by secret ballot.
Both houses of parliament vote in a first round, with the top four candidates progressing to a second round.
Whoever wins that second round will govern the country for the next four years.
Past elections were marred by allegations of vote buying with candidates reportedly offering money in exchange for support.
BDST: 1910 HRS, MAY 15, 2022