MOGADISHU, Somalia - Somalia's government claimed victory over an Islamic insurgency yesterday just hours after a surge in violence killed 58 people in the capital, but diplomats said they were skeptical the worst fighting in more than 15 years had ended.

Somalian troops and their Ethiopian allies have been trying to wipe out the insurgents since late March, with the unrelenting rain of mortar shells and artillery taking the highest toll on civilians. Rights groups say the fighting has killed more than 1,000 people and sent up to 400,000 fleeing for safety.

Machine-gun and artillery fire could still be heard in the south of Mogadishu, a wrecked coastal city of two million people. Fifty-eight people, mainly civilians, were killed in fighting early yesterday as the Ethiopian and government forces drove insurgents out of their stronghold in the north of the city, according to Somalia's Elman Human Rights Organization.

In the last nine days, the death toll reached more than 400.

"We have won the fighting against the insurgents," Prime Minister Ali Mohamed Gedi told the Associated Press, saying small, mopping-up operations were still under way.

However, Western diplomats said that although the insurgents had suffered large numbers of casualties and were running low on ammunition, they were not defeated. They spoke on condition of anonymity for fear of damaging relations with Somalia's government.

Somalia is facing a dire humanitarian crisis after the fighting leveled homes and sent hundreds of thousands of civilians into squalid camps or seeking shelter along roadsides.

The United Nations' top humanitarian official said yesterday that more people had been displaced in Somalia than anywhere else in the world this year. And, he said, international aid groups had access to only a fraction of them.

"The situation is indeed extremely worrying," said John Holmes, U.N. undersecretary-general for humanitarian affairs.