Updated

The international community on Tuesday supported the election of a new president for Somalia, saying it's a step toward moving the country out of its failed-state status but that much more remains to be done in a country bloodied by two decades of war.

Hassan Sheikh Mohamud, a political newcomer, won the election in parliament Monday against outgoing President Sheik Sharif Sheikh Ahmed by a vote of 190 to 79.

Somalia has had transitional administrations since 2004. Mohamud, an academic and activist is expected to form the county's first functioning central government since 1991, when warlords overthrew a longtime dictator.

Somalia's president faces an uphill task unifying a fractious country in the face of an al-Qaida linked-Islamist insurgency and rebuilding a bombed-out infrastructure, food security and institutions. Another challenge is fighting endemic corruption that plagued previous governments.

Augustine Mahiga, the U.N. special representative for Somalia, said a new era for Somalia has begun. The U.S. hailed the vote as an important milestone for the people of Somalia and a crucial step along the path of building a representative government. In Brussels, the European Union pledged continuing support to the new administration. EU foreign policy chief Catherine Ashton called Mohamud to congratulate him.

Ashton said Mohamud "has a strong mandate to establish a new government that can rebuild the country, and that he should take advantage of the impetus that comes with the end of the transition process," spokesman Michael Mann said.

Somalia has seen much progress over the last year.

Al-Qaida-linked Al-Shabab militants were forced out of Mogadishu in August 2011, allowing businesses to thrive and the arts and sports to return. The militants have largely either fled to northern Somalia or Yemen, or have retreated to Kismayo, the last major town the militants' control.

Last month Somali leaders endorsed a new provisional constitution that expands rights for Somali citizens.

The U.N . — which helped broker the constitution and was in charge of the poll — hopes that one day all of Somalia will be able to vote. The lack of security around the country this time prevented that.

In a statement from U.N. headquarters in New York, Secretary General Ban Ki-moon encouraged Mohamud "to move expeditiously, to appoint an inclusive, accountable Government that can begin the work of peacebuilding in the country."

He also urged the international community to pledge continued support for the East African nation.