MOGADISHU, Somalia — Somalia's president resigned Monday after a four-year term in which his Western-backed government failed to extend its power throughout a country crippled by infighting and a strengthening Islamic insurgency.
Abdullahi Yusuf's resignation, which comes amid deepening international pressure, could usher in more chaos as Islamic militants scramble for power _ even though the government controls only pockets of the capital, Mogadishu, and the seat of parliament in Baidoa.
Within hours of the announcement, mortar shells slammed into the streets near the presidential palace in Mogadishu, where the government maintains a token presence.
Somalia has been beset by two decades of anarchy, violence and an insurgency that has killed thousands of civilians and sent hundreds of thousands fleeing for their lives.
"Most of the country is not in our hands," Yusuf said in a speech before parliament in Baidoa, referring to Islamic insurgents with alleged ties to al-Qaida.
In Washington, the U.S. State Department supported Yusuf's decision to resign and praised his efforts to bring peace and stability to Somalia. The statement by Gordon Duguid, the department's acting deputy spokesman, urged officials in Somalia "to intensify efforts to achieve a government of national unity and to enhance security through formation of a joint security force."
When Yusuf took office in October 2004, the country had been divided into fiefdoms ruled by rival warlords since 1991, when a socialist dictator was overthrown. There were more than a dozen previous peace efforts and two previous governments, but they never managed to take effective control over the country.
Yusuf's government has never been strong.
The last time Yusuf lost his grip on the nation to Islamic insurgents, in 2006, he made the unpopular decision to call in troops from neighboring Ethiopia to prop up his administration. The call backfired _ Somalis saw the Ethiopians as "occupiers" and accused them of brutality.
The insurgents used the Ethiopian presence as a rallying cry to gain recruits even as the Islamists' strict form of Islam terrified many Somalis into submission.
In many ways, Yusuf is leaving Somalia much as he found it. But this time, insurgents are in control of most of the country, prompting fears it could become a haven for terrorists.
Meanwhile, all public institutions have crumbled and the once-beautiful seaside capital is now a gun-blasted shantytown. The lawlessness also has allowed piracy to flourish off the coast in the Gulf of Aden, one of the world's busiest shipping lanes.
In the address broadcast nationwide on the radio, Yusuf said he could not unite Somalia's bickering leadership and that the country was "paralyzed."
"After seeing all these things, I have finally quit," Yusuf said. Meanwhile, the Ethiopian troops are scheduled to pull out this week, leaving a power vacuum.
The parliament speaker will stand as acting president until parliament elects a new leader within 30 days. There have been no announcements of who might be under consideration, but many believe Yusuf's absence will allow moderate Islamist leaders into the government.
The most aggressive Islamic insurgency group, al-Shabab, has made dramatic territorial gains in recent months, and insurgents now control most of the country. The statement said it was too early to tell if Yusuf's replacement would be an improvement.
The United States accuses al-Shabab of harboring the al-Qaida-linked terrorists who blew up the U.S. embassies in Kenya and Tanzania in 1998. Many of the insurgency's senior figures are Islamic radicals; some are on the State Department's list of wanted terrorists.
The U.N. envoy to Somalia, Ahmedou Ould-Abdallah, who has been trying to salvage an ineffective peace deal in the country, welcomed Yusuf's resignation and said "a new page of Somalia history is now open."
The United Nations has brokered peace deals between the government and an opposition faction, but they have failed to quell the political and violent chaos. Al-Shabab has refused to participate in the talks.
Thousands of civilians have been killed or maimed by mortar shells, machine-gun crossfire and grenades in fighting in this arid 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.
Rights groups have accused all sides in the conflict _ Islamic insurgents, the government and Ethiopian troops _ of committing war crimes and other serious abuses.
Ethiopia's planned withdrawal of troops would end their unpopular presence and leave the administration more vulnerable to insurgents. The Ethiopians entered Somalia two years ago with the tacit approval of the United States to drive out an earlier group of Islamic insurgents.
Somalia has been ravaged by violence since warlords overthrew dictator Mohamed Siad Barre in 1991 and then turned on one another. The current transitional government was formed with U.N. help in 2004.
Yusuf, a former Somali army colonel in the 1960s, was jailed by Barre when he refused to cooperate in a coup d'etat in 1969. Although Yusuf is a member of one of Somalia's four biggest clans, the Darod, he was unpopular in Mogadishu because of his ties to Ethiopia _ one of Somalia's traditional enemies.
Elizabeth Kennedy reported from Nairobi, Kenya. Associated Press writers Mohamed Sheikh Nor in Mogadishu and Malkhadir M. Muhumed in Nairobi also contributed to this report.