Somali President Abdullahi Yusuf Ahmed resigned amid an internal power struggle Monday after failing to bring peace to the Horn of Africa nation, which has been wracked by conflict for the past 17 years, according to dpa. "Today I resign the post that you elected me to on October 14, 2004," Yusuf told lawmakers in Baidoa, the seat of the Somali parliament. "I stated at that time that there were three options ... I will overcome the crises, continue the post until my death or resign if I can't continue." Yusuf said that the parliamentary speaker would act as president until a new election could be organized. While the president did not link his resignation to the recent political turmoil, has position was weakened when parliament in mid- December refused to back his decision to fire Prime Minister Nur Hassan Hussein. Nonetheless, Yusuf pushed on and appointed a new prime minister, who himself resigned a few days later. The move brought widespread condemnation for Yusuf. He was branded an obstacle to peace and regional governments imposed sanctions on him. Hussein accused Yusuf of trying to derail the UN-sponsored peace process between the Transitional Federal Government and opposition group the Alliance for the Re-Liberation of Somalia (ARS). The UN Special Representative for Somalia, Ahmedou Ould-Abdallah, praised Yusuf for his "patriotic and courageous" decision and called up on Somalis to put their differences aside to bring about peace. "I invite them (the Somali people) to take this opportunity to rise above their differences," he said in a statement. "It's time is for unity and solidarity." However, unity is looking extremely unlikely. Islamist insurgents have taken advantage of the political infighting to advance to the edge of Mogadishu.. Somalia has been embroiled in chaos ever since the 1991 ouster of dictator Mohamed Siad Barre. The crisis deepened when Ethiopian forces invaded two years ago to help kick out a hardline Islamist regime, sparking a bloody insurgency that has killed over 10,000 civilians. The resignation comes as Ethiopia prepares to pull its troops out of Somalia. Main insurgent group al-Shabaab has refused to take part in the peace process and there are fears that it will overrun Somalia completely when the Ethiopians leave. The insurgent group has been implementing strict Islamic law as it takes over towns, and many are concerned of a radicalization of the population should it gain complete control. The US says that al-Shabaab has close links to al-Qaeda. Only ramshackle government forces and an undermanned African Union force of around 3,000 troops and stand between al-Shabaab and control of Somalia. The AU is desperately trying to scrape up more troops to send in. UN Secretary General Ban Ki-moon has rejected calls to send in a peacekeeping mission, saying there is "no peace to keep." However, the insurgents are far from united and analyst have been warning that Ethiopia's departure could lead to a splintering of the groups. This seems to be taking place already. A relatively new Islamist group, Ahlu Sunna Waljamaca, fought al-Shabaab on Sunday and claimed to have killed around ten of its fighters. The group says it opposes al-Shabaab's hardline policies and has declared war because al-Shabaab killed religious leaders and desecrated graves.