Mohamud, 56, won 190-79 votes in a secret ballot. He defeated incumbent President Sheikh Sharif Ahmed after two of the four candidates who entered the second round of voting pulled out. One of the candidates who dropped out, outgoing Prime Minister Abdiweli Mohamed Ali supported Mohamud and said the latter's victory meant that the Somalian people were set to witness a change.
After the declaration of the results, Mohamud, the leader of the Peace and Development Party which was set up last year, said the people of Somalia were now headed for a new direction and all difficulty was a thing of the past.
Mohamud, an academic and a moderate, will face serious challenges in hostile clan politics, corruption (Somalia is known to be the most corrupt country in the world), piracy in the seas and Islamist insurgency.
Somalia witnessed a declining central government since the outbreak of the civil war two decades ago in which several people were massacred. However, the situation has slowly changed in the capital in last one year and Monday's voting was a culmination of a UN-backed and regionally-brokered roadmap to end the clash.
The militants are still active in southern and central Somalia while pirates, parochial administrative groups and local militias struggle to control areas of the largely lawless country.
(With agency inputs)