A former prime minister was elected Somalia's president on Wednesday, declaring a new "era of unity" as he took on the daunting task of bringing the long-chaotic country its first fully functioning central government in a quarter-century.

Advertising Read more

Thousands of jubilant Somalis poured into the streets, chanting the new president's name as cheering soldiers fired into the air. "Somalia will be another Somalia soon," said Ahmed Ali, a police officer celebrating in the crowd.

Incumbent President Hassan Sheikh Mohamud held a slight lead over Farmajo after an initial round of voting Wednesday that included a field of 21 candidates. But Farmajo easily won the second round contested among three candidates, with 184 votes to Mohamud's 97.

Fears of attacks by the Islamic extremist group al-Shabaab dogged the historic vote, which was limited to lawmakers instead of the population at large, with members of the upper and lower houses of parliament casting ballots at a heavily guarded former air force base in the capital, Mogadishu, while a security lockdown closed the international airport.

The new president represents a generation of Somalis scattered abroad by conflict who have cautiously begun to return to help their homeland recover.

(FRANCE 24 with AP)

Daily newsletterReceive essential international news every morning Subscribe