Updated

Hundreds of Ethiopian soldiers were pulling out of the Somali capital on Friday, witnesses said — amid fears the troops' departure will allow Islamic insurgents to take even more control of the lawless country.

Ethiopia has been propping up Somalia's weak government for two years, but vowed to leave by the end of 2008. Officials declined to give an exact date because of fears of a power vacuum, saying only that the thousands of troops would be pulled out in stages.

It was not immediately clear how many were leaving Friday, but residents said they saw hundreds on the move. Ethiopia has not said how many soldiers are in Somalia, but most are in the capital, Mogadishu.

"This is the first time we saw Ethiopian soldiers moving out of Mogadishu in such numbers," resident Dahabo Awnure told The Associated Press.

The Ethiopians were called on in 2006 to prop up the U.N.-backed government and rout Islamic militants who had taken over most of the country. Initially, the superior firepower worked — the Islamists were driven from power. But they quickly regrouped and launched an Iraq-style insurgency that continues today.

Earlier this week, Abdullahi Yusuf resigned as president, saying he had lost control of the country to Islamic insurgents and could no longer fulfill his duties after four years in office.

Many Somalis have seen the Ethiopians as occupiers, and the insurgents have used their presence as a rallying cry to gain recruits — even as the militants' strict form of Islam terrified people into submission.

Mogadishu resident Salado Abdi Salan said the departing troops "looked happy, and some of them waved to the children as they passed."

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.

The most powerful insurgent group, al-Shabab, has taken control of vast amounts of new territory in recent months. Washington 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 U.S. State Department's list of wanted terrorists.

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