How does it work?
Elections in Somalia have been rescheduled half a dozen times until everyone agreed upon a way to go about choosing a president.
The system finally adopted was the "least objectionable compromise".
This is how it works: 135 clan elders chose 14,025 delegates who then voted for each of the 275 seats in the lower house of parliament, distributed according to clan.
Upper house seats were distributed by region, and were increased from 54 to 72 after complaints of insufficient representation by some clans.
The two houses will now elect a president on Wednesday.
How is this different from previous elections?
When the last elections were held in 2012, only 135 clan leaders chose the MPs who voted for the president.
This election is similar in some ways but is more inclusive and well-represented, the supporters of the new system said.
The original promise of a one-person, one-vote national poll had to be abandoned in 2015 because of political infighting and a lack of basic requirements such as an electoral roll.
The election were initially scheduled for August 2016 but was delayed several times.
"This election model, unique in the world, is a stepping stone, a political construct to help us get to the next stage," the United Nations special envoy to Somalia, Michael Keating, said.
What do the people think of it?
"I really don't care who becomes president. We just need to be free to attend to our business," Qoje Siyad, a day labourer in Somalia's capital Mogadishu, said.
Some people have held on to optimism.
“Today is great day for me and for people in Somalia. All I can do today is just watch TV and pray for the country so we can have a good leader who is committed to make this country peaceful and democratic,” another resident of Mogadishu was quoted as saying by the Guardian.
The long-delayed election has also seen plenty of allegations of corruption.
“This is probably the most expensive election, per vote, in history,” the Mogadishu-based anti-corruption group Marqaati said in a report released on Tuesday.
Who is in power right now?
President Hassan Sheikh Mohamud, a 61-year-old former academic and activist from the Hawiye clan. He is seeking re-election.
President Mohamud, who has led the country since 2012 as it tries to rebuild after more than two decades of war and chaos, has the support of about a third of lawmakers, experts said, giving him an edge but not a guarantee of victory.
In fact, no candidate is expected to get the two-thirds majority needed for a first-round win, with two further rounds permitted before a winner is declared.
In the absence of political parties, clans remain the organise and shape Somali politics.
All 23 candidates are men. The only female candidate dropped out.
Why is the world keeping an eye on things in Somalia?
The overthrow of president Siad Barre's military regime in 1991 ushered in decades of conflict in a country deeply divided along clan lines. Somalia was branded a "failed state".
The international community by 2011 had spent $55 billion to aid Somalia, the Center for American Progress said.
The clan rivalries and lawlessness provided fertile ground for the Al-Qaeda linked militant group Al Shabaab to take hold and seize territory, frustrating efforts to set up a central administration.
Al Shabaab has been in decline since 2011 but still launches regular, deadly attacks against government, military and civilian targets in the capital Mogadishu and elsewhere.
Security and overcoming Somalia's adversarial and divisive politics will top the agenda for whoever wins the vote as will dealing with a growing humanitarian crisis.
The UN warned last week of "possible famine" in Somalia as a severe drought has pushed nearly 3 million people to the edge of starvation.