The top U.N. official for war-torn Somalia says the country is no longer a failed state but a recovering fragile country.

Nicholas Kay, the outgoing representative for the U.N. Secretary General in Somalia, says in the last three years the country has stabilized but there is still a lot of work to do.

Kay said Somalia's Islamic extremist group al-Shabab will not succeed in undermining the progress being made but the prospect of al-Shabab elements pledging allegiance to the Islamic State group is a real concern.

Somalia has been torn by decades of conflict since the 1991 ouster of long-time dictator Siad Barre. Somalia had transitional administrations since 2004 but until the 2012 election of President Hassan Sheik Mohammud, it had not had a functioning central government since 1991.