Ali Mohamed Gedi, the Somali prime minister, on Thursday declared a military triumph of government-backed Ethiopian troops over the Muslim and clan fighters, after ferocious clashes that killed nearly 400 people and displaced as many as 400,000.
Hussein Mohamed Muhamoud, a government spokesman, said on Friday that fighting had ended in Mogadishu and authorities were seeking to restore law and order.
"The time of violence is over. Somalis should advance peace and harmony to develop their lives," he said, claiming reports of looting were "propaganda".
Salad Ali Jelle, the Somali deputy defence minister, conceded that looting was taking place, but denied the army was involved.
He said the looters had stolen army uniforms.
He said: "Government forces are now in charge of the capital and it's their duty to stop any violation against the civilians and their properties.
"Those who are looting are civilians wearing army uniforms."
Ethiopian and Somali troops patrolled the city as residents solemnly collected rotting bodies abandoned in the streets. Residents said soldiers were arresting people as they searched their homes.