Mortars slammed into a busy market in Somalia's capital Tuesday, witnesses said, as the country's weak government crumbled and the impending pullout of allied Ethiopian troops raised fears that Islamic insurgents might seize the opportunity to take over.

At least 10 people were killed in the market attack, witnesses said.

The fighting began after Islamic insurgents attacked bases of government soldiers and African Union peacekeepers, said Salado Mohamed Farah, a shop owner at Bakara market. He said mortars fired in retaliation hit the market, which the government has accused the insurgents of using as a base.

"There is blood everywhere," Farah told The Associated Press. "The mortars fell as people were busy shopping."

The bloodshed — so common in this lawless nation in the Horn of Africa — adds to the deepening political crisis. Ethiopian troops who are propping up Somalia's government will leave the country within days despite the turmoil caused by the resignation of the Somali president on Monday, an official said Tuesday.

Wahide Belay, a spokesman for the Ethiopian Foreign Ministry said he did not want to discuss a specific date for the departure, which many fear will create a power vacuum and allow Islamist insurgents to take over Somalia.

"We are leaving at the end of December," Wahide said. "Give or take a couple of days." The plan to pull the troops from Somalia had been announced earlier. Belay's statement was confirmation that the withdrawal will proceed in spite of the fresh political uncertainty.

During President Abdullahi Yusuf's four-year term, his Western-backed government failed to extend its power throughout the country, which is crippled by infighting and a strengthening Islamist insurgency.

Yusuf's resignation could usher in more chaos as Islamic militants scramble for power. The government controls only pockets of Mogadishu, the capital, and Baidoa, the seat of Parliament.

For two decades, Somalia has been beset by anarchy, violence and an insurgency that has killed thousands of civilians and sent hundreds of thousands fleeing for their lives. Some of the insurgents are alleged to have ties with Al Qaeda.

"Most of the country is not in our hands," Yusuf told Parliament Monday.

The U.S. State Department supported Yusuf's decision to resign and praised his efforts to bring stability to Somalia. The statement by Gordon Duguid, a department 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."

The last time Yusuf lost his grip on the nation to the insurgents, in 2006, he called in troops from neighboring Ethiopia to prop up his administration. The call backfired — many Somalis saw the Ethiopians as "occupiers" and accused them of brutality.

The insurgents have used the Ethiopian presence to gain recruits even as the Islamists' strict form of Islam has terrified many Somalis.

Parliament must elect a new president within 30 days; in the meantime, the Parliament speaker will serve as acting president. Many believe Yusuf's absence will allow moderate Islamist leaders into the government.

The most aggressive Islamic insurgency group, al-Shabab, has taken control of vast amounts of new territory in recent months. The United States accuses al-Shabab of harboring the Al-Qaeda-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.

Thousands of civilians have been killed or maimed by mortar shells, machine-gun crossfire and grenades in fighting in this arid country.