The last of the Islamist fighters have retreated to the Kenya border, about 150 miles away.
It provides money to some Islamist fighters to help them start new lives and even seeks to expunge the word terrorist from the national discourse.
The military clashed with the alleged Islamist fighters outside the city and shelled the outskirts of the town.
Over a month of fighting, 567 people were reportedly killed, including 429 Islamist fighters, 78 soldiers, 26 tribal fighters and 34 civilians.
At the same time, troops fought Islamist fighters on the western edge of Jaar.
A truce was made on August 24 to allow the 63 family members, 25 women and 38 children, of the Islamist fighters to leave the camp.
However the next day at least fifteen people died and twenty-five injured after Islamist fighters attacked government positions in the northern part of the city.
But reports from Mogadishu suggested that the vast majority of the Islamist fighters had left the city - or gone underground.
The military assault propelled the former Islamist fighter to international prominence.
The fighting started early Wednesday as hundreds of Islamist fighters attacked the transitional government's forces from two sides.