A moderate Islamist leader, Sheikh Sharif Sheikh Ahmed, has been chosen  as the new president of Somalia. The new president, who has the general backing of the international community, was elected by members of Somalia's transitional parliament in Djibouti early Saturday.

Sheikh Sharif received 293 votes in a runoff round, defeating Maslah Mohammed Siad Barre, the son of former President Mohamed Siad Barre, who received 126 votes.  Sheikh Sharif will replace Abdullahi Yusuf, a former warlord who stepped down as president, under international pressure, in December after four years in office.

Sheikh Sharif's victory appeared assured after Prime Minister Nur Hassan Hussein withdrew from the race. After the vote, Sheikh Sharif praised Hussein.

Since Sheikh Sharif and Hassan both belong to the same clan, Hassan is barred by Somalia's constitution from remaining as prime minister.

Sheikh Sharif headed the Union of Islamic Courts that took control of Mogadishu in late 2006 before being ousted by Ethiopian troops backed by the United States. He has since emerged as the face of the moderate Islamist opposition, with substantial backing from many of Somalia's various factions. Ethiopia meanwhile, withdrew its troops from the country following two years of battling Islamist insurgents.

Following the vote on Saturday, thousands of Sheikh Sharif's supporters celebrated in the streets of Mogadishu.

Last year, Sheikh Sharif's wing of the opposition Islamist Alliance for the Reliberation of Somalia signed an agreement with the transitional government, part of United Nations-backed peace talks being held in Djibouti. This week, the parliament voted to double its numbers to take in 200 members of Sheikh Sharif's group. The UN's special representative for Somalia, Ahmedou Ould Abdallah, called on Somalia's lawmakers to come together.

"Give yourself and your people a new sense of hope. Ensure that today's election is a break from past practices. At the end, Somalis, including all of you will be the winner. The failures and successes of the last two decades should provide important political lessons and help you to move forward in a positive spirit of reconciliation," said  Abdallah.

Sheikh Sharif now faces the immensely difficult job of finding a solution to the violence and lawlessness that has plagued Somalia for the past two decades. He called on other armed factions to join the peace process. The radical Islamist al-Shabaab, responsible for much of the violence on the ground in Somalia, as well as the hardline members of the Islamist Alliance for the Reliberation of Somalia, have rejected the peace agreement signed by Sheikh Sharif.