A loud blast destroyed the office in Mogadishu's Hodan district and sent up huge clouds of smoke. A Reuters reporter saw five bodies and the body parts of a sixth person.
"We have carried six dead people and 16 others injured. The death toll may rise," Abdikadir Abdirahman, director of Amin Ambulance service, told Reuters.
Al Shabaab - which is fighting to topple the government and establish its own rule based on its interpretation of Islamic law - said it was behind the attack.
"We completely destroyed the district headquarter office. There are many casualties. We shall give details later," Abdiasis Abu Musab, al Shabaab's military operation spokesman, said.
The Islamist militant group has frequently carry out attacks in the capital and other areas since the army, backed by African peacekeepers, pushed it out of the capital in 2011.
Witness Hussein Osman said he saw a 4x4 vehicle run into the building.
"I was just outside the district office ... I ran away and now I see from far the office completely destroyed," he added.
Last week, a suicide car bomb destroyed another district office in Mogadishu.
Somalia has been gripped by violence and lawlessness since dictator Mohamed Siad Barre was toppled in 1991.