Somalia's prime minister claimed victory Thursday over Islamic insurgents in Mogadishu, where nine days of battles using tanks and artillery left hundreds dead.

Western diplomats were skeptical of the claim. The diplomats, who spoke on condition of anonymity for fear of damaging relations with Somalia's interim government, said the insurgents had suffered many casualties and were running low on ammunition, but were not yet defeated.

Prime Minister Ali Mohamed Gedi said government forces and their Ethiopian allies had captured an insurgent stronghold in the northern part of the capital and that more than 100 fighters had surrendered. He said the city should be secure by Friday.

"We have won the fighting against the insurgents," Gedi told The Associated Press by telephone from Mogadishu, saying that small, mopping-up operations were still under way. "The worst of the fighting in the city is now over."

Machine gun and artillery fire could still be heard in the south of Mogadishu, a coastal city of 2 million people. An estimated 340,000 Somalis have fled the city's worst fighting in 15 years.

"People can now return to their homes," Gedi said. "The rest of the fighting will be over soon. We have captured the stronghold of the terrorists. We will capture any terrorists who have escaped."

The insurgents are linked to the Council of Islamic Courts, which was driven from power in December by Somali and Ethiopian soldiers, accompanied by U.S. special forces. The U.S. has accused the courts of having ties to Al Qaeda.

The militants reject any secular government, and have sworn to fight until Somalia becomes an Islamic emirate.

Somalia has been mired in chaos since 1991, when warlords overthrew dictator Mohamed Siad Barre and then battled each other. A national government was established in 2004 with U.N. help, but it has failed to assert any real control.