Within hours of the announcement, mortars shells were raining down near the presidential palace in the capital, Mogadishu. Abdullahi Yusuf announced his resignation to parliament in Baidoa -- one of the only Somali towns controlled by the weak government, which has been sidelined by an increasingly powerful insurgency. The parliament speaker will stand in as acting president until Somalia can hold elections.

Yusuf said in an address broadcast on radio nationwide that he could not unite Somalia's bickering leadership, and that the country was "paralyzed."

"Most of the country is not in our hands," Yusuf said. "After seeing all these things I have finally quit."

Yusuf's administration failed to bring security to the war-ravaged nation and now controls only Baidoa and pockets of Mogadishu. The most aggressive insurgency group, al-Shabab, has made dramatic territory gains in the past few months, and insurgents now control most of the country. In a statement on Monday, al-Shabab said Yusuf was resigning "with shame."

Yusuf's resignation could usher in more political and violent chaos as various militias jockey for position and power. Thousands of civilians have been killed or maimed by mortar shells, machine-gun crossfire and grenades in near-daily fighting in this arid, Horn of Africa country. The United Nations says Somalia has 300,000 acutely malnourished children, but attacks and kidnappings of aid workers have shut down many humanitarian projects.

The lawlessness also has allowed piracy to flourish off the coast. Rights groups have accused all sides in the conflict -- insurgents, the government and troops from neighboring Ethiopia who are here supporting the administration -- of committing war crimes and other serious abuses for indiscriminately firing on civilian neighborhoods. The United States accuses al-Shabab of harboring the al-Qaeda-linked terrorists who blew up the US embassies in Kenya and Tanzania in 1998. Many of the insurgency's senior figures are radicals; some are on the State Depart-ment's list of wanted terrorists.

AP MOGADISHU