“Considering the interest of the Somali people and the current situation in Somalia, I have decided to leave my office,” Mohamed told reporters in the capital Mogadishu.
Under the terms of the June 9 agreement, brokered in Uganda, whose troops form the backbone of the peacekeeping force in Somalia, a new prime minister must be appointed within 30 days. The new head of government will then name a new cabinet, to be approved by parliament.
The international community is keen to see a pick-up in the pace of political reform and military gains against rebels linked to al Qaeda.
The Islamist al Shabaab fighters have attracted a growing number of aspiring militants from the United States, Europe, the Gulf and south Asia. Western intelligence agencies warn Somalia might be used as a launch pad for attacks across the region.
Mohamed, a U.S.-educated former diplomat who returned last year to head a government riven by internal fighting and corruption, said he would not be leaving Mogadishu and expected to assist the new government.
Credited with launching a crackdown on graft, paying public sector salaries and improving security in Mogadishu, Mohamed said he hoped his cabinet would be retained.