Somalia's lawmakers voted overwhelmingly on Monday for Hassan Sheikh Mohamud as the country's next president, with the streets of the capital erupting into celebratory gunfire, Reuters witnesses said.
Two of the four candidates who made it to the second round of voting opted out, leaving the incumbent President Sheikh Sharif Ahmed and Mohamud.
Members of parliament in Somalia had voted for a new president Monday in the first poll of its kind in decades, despite suspicions the election would be rigged and do little to alter the political landscape.
Billed by the United Nations as a milestone in the war-ravaged country's quest to end two decades of violence, graft and infighting, newly selected lawmakers convened at the police academy to vote for the next head of state by secret ballot.
"It's D-day for Somalia," lawmaker Abdirahim Abdi said of the election in which more than two dozen candidates were running, including the current president and prime minister as well as prominent Somalis who have returned from overseas.
"It's a turning point for Somalia and everyone's been waiting for it," he told Reuters.
There has been no effective central government control over most of the country since the outbreak of civil war in 1991.
Monday's vote is seen as a culmination of a regionally brokered and UN-backed roadmap to end that conflict, during which tens of thousands were killed and many more fled.
The capital, which until last year witnessed street battles between Al-Qaeda-linked Al-Shabab militants and African soldiers, is now a vibrant city, where reconstructed houses are slowly replacing bullet-riddled structures.
But despite being on the back foot, the militants still control swathes of southern and central Somalia, while pirates, regional administrations and local militia group also vie for control chunks of the largely lawless Horn of Africa country.
Somalia's president heads the executive branch, while the speaker of parliament is considered the country's most powerful politician and steps in if the president is unable to fulfill his duties.
"Any elected president must cope with security first, then the reconstruction of social infrastructure, resettling the numerous [refugees] around the country and the liberation of the rest of the country from Al-Shabab," said student Bashir Ali Abdikadir.
Members of parliament marked their ballot papers behind a curtain before casting them in a clear box in front of foreign envoys and hundreds of Somali men and women as well as being broadcast live on television.
If no one candidate secured a two-thirds majority in the first round and a simple majority in the second, the election would have gone to a third round.