Mr. Mohamud defeated incumbent leader Sheikh Sharif Sheikh Ahmed in a third round run-off vote Monday.
Speaker of parliament Mohamed Sheikh Osman said the new president won in a landslide.
“Sharif Sheikh Amed got 79 votes. Hassan Sheikh Mohamud got 190 votes.”
Another two votes were disqualified.
Mr. Mohamud was immediately sworn in following the vote. He thanked former President Ahmed for leading the country toward historic elections and asked the Somali people to support him.
“I want to ask the Somali people to lend me their helping hand, effortlessly, in order to establish a functioning government throughout Somalia.”
Former President Ahmed conceded defeat in a speech before parliament and said he would support the new president.
“I want to congratulate my brother Hassan Sheikh Mohamud the next president of the Federal Government of Somalia. I want to state that I respect the result, it was fair and I accept it accordingly.”
The election was a major step in a U.N.-backed plan to create a more effective government in Somalia after two decades of war and chaos.
It followed adoption of a new constitution and the creation of a new parliament last month.
Mr. Mohamud and Mr. Ahmed were the last candidates standing after a day of voting that began with 22 presidential hopefuls.
The new president is 56 years old, a lifelong civil society activist and leader of the Peace and Development Party.
He takes over a country that has not had a stable central government since 1991. However, hopes for peace and stability are rising. Militant group al-Shabab has lost most of its major strongholds to African Union and Somali government forces, and peace has largely returned to Mogadishu, which endured years of almost daily fighting.