JOHANNESBURG, Dec. 28 -- Ethiopian-backed troops moved unopposed into Somalia's unruly capital of Mogadishu on Thursday, taking over from fleeing Islamic fighters as clan elders and politicians met in an effort to establish the first viable secular government in the country since 1991.

Soldiers of the Transitional Federal Government, which was patched together two years ago in neighboring Kenya with limited support in Somalia, advanced along streets to cheers but also looting and mayhem, according to news reports. They arrived at the ancient oceanside city after a five-day blitz by tanks and warplanes of the Ethiopian armed forces.

Islamic fighters who for six months had enforced a rigid moral code in Mogadishu disappeared, some simply shaving their long beards and vanishing into neighborhoods, witnesses said. "We have been defeated. I have removed my uniform. Most of my comrades have also changed into civilian clothes," one former Islamic fighter told the Reuters news agency. "Most of our leaders have fled."

Retreating south along the Indian Ocean coast from a city scarred by a decade and a half of intermittent war, leaders of the Islamic Courts movement vowed to continue the fight. Analysts warned that the force's apparent collapse could be followed by an Iraq-style insurgency that would keep the impoverished country unstable through a mix of assassinations, car bombs and political action.

The United States, concerned that Somalia under the Islamic Courts movement was a haven for terrorists, has given tacit support to Ethiopia, saying the country has legitimate security concerns. In the Muslim world, Christian-dominated Ethiopia is widely seen as acting at U.S. behest against a Muslim country.

Some analysts fear the war could touch off a humanitarian catastrophe across the Horn of Africa. On Thursday, two boats carrying Somalis illegally into Yemen capsized after Yemeni security forces opened fire on other boats near them, according to news agency reports. At least 17 people were killed and 140 were missing. Survivors said they were fleeing the fighting, but some international officials said the people were more likely part of a regular flow of economic immigrants from Somalia.

It was clear Thursday night that the complex political dynamics in Mogadishu, and Somalia in general, had been completely reordered by the swift, potent military action by Ethiopia. Its tanks, jets and attack helicopters routed loosely organized Islamic militia units that were armed with little more than rifles and pickup trucks with mounted machine guns.

Ethiopia had long vowed not to let Islamic fundamentalists take control of Somalia. It attacked after Islamic forces probed toward Baidoa, the only town then controlled by Somalia's transitional government and a fragile bulwark against the rising power of the Islamic group.

"This is a golden opportunity for Somalia," said Bereket Simon, an adviser to Ethiopian Prime Minister Meles Zenawi, speaking from the Ethiopian capital, Addis Ababa. "The extremists have been defeated. Our hope is the situation will quickly stabilize."

Meles, also speaking in Addis Ababa, promised to quickly finish off the remnants of the Islamic forces and bring southern Somalia under control. "We are discussing what we need to do to make sure Mogadishu does not descend into chaos. We will not let Mogadishu burn," he said.

The role of the Ethiopians, whom many Somalis regard as archenemies after decades of border skirmishing and a full-blown war in the 1970s, added to the combustible mix of forces in Mogadishu. The Ethiopian flag has been burned in regular demonstrations there in recent months, as prospects grew stronger of armed intervention by a hated neighbor.

As troops from Ethiopia and the transitional government approached Mogadishu, a hardened core of Islamic fighters fled toward the coastal city of Kismaayo, leaving so abruptly that many left behind their weapons. "We don't want to see Mogadishu destroyed," Sharif Ahmed, a leader of the group, said in an interview televised on the Arabic satellite network al-Jazeera.