MOGADISHU, Somalia - Islamic insurgents have retreated from areas around Somalia's presidential palace after a day of fighting that killed dozens of people and wounded about 150, witnesses said Monday.

Gunshots could still be heard Monday, but insurgent fighters and government troops returned to their positions. Somali military spokesman Farhan Asanyo said the government made a strategic retreat.

"Instead of chasing and forcing them to melt into the community, we prefer our enemy to come and face us at the front lines so that they taste the death as they did yesterday," Asanyo said.

Sunday's fighting marked the first time African Union peacekeepers directly intervened to support government forces.

The AU was forced to intervene after the insurgents fought their way to just over half a mile (1 kilometre) from the presidential palace, Mogadishu Deputy Mayor Abdifitah Shawey said. The 4,300 beleaguered peacekeepers generally try to avoid being drawn into the conflict to preserve their neutrality.

They defend the capital's port, airport and key government buildings.

Islamic insurgents with alleged ties to al-Qaida recently intensified their efforts to capture Mogadishu after an exiled leader returned in April and pulled the disparate insurgent factions together into an alliance.

"It is quite calm today here, but the fighting may erupt at any time," said Mogadishu resident Abukar Jimale.

The U.N. Special Representative for Somalia, Ahmedou Ould-Abdallah, said civilians were bearing most of the violence, adding that the Somali forces were being cautious.

"Despite the restraint from the Somali forces and others, attacks continued against government institutions and innocent civilians with massive abuses of human rights and killings," he said in a statement Monday. "It is in response to this that government forces had no alternative but to defend Mogadishu's population."

There was no clear word on casualties. Official death tolls are notoriously unreliable and both sides have manipulated casualty figures in the past. Shawey said three government soldiers were killed. Government commander Salad Ali Jelleh said 40 insurgents died, but did not specify how the bodies were identified.

Various Islamist groups have been fighting the U.N.-backed government since being chased from power 2 1/2 years ago. The situation is complicated by the continual splintering and reforming of alliances and a tangled web of clan loyalties.

The impoverished Horn of Africa nation has not had a functioning government for 18 years.