Several police stations and security checkpoints in Mogadishu, the Somali capital, were attacked early on Wednesday, officials and militants said.
It comes as the nation prepares for a much-delayed presidential election.
Internal Security Minister Abdullahi Nor accused Al Shabaab militants of carrying out the attack.
Al-Shabab spokesman, Abdiasis Abu Musab, said the fighters hit government targets in four districts of the capital and another area on the outskirts. He said the militants invaded government bases and seized military vehicles and weapons.
Al-Qaeda-linked militants carry out frequent attacks on the government and last week attacked a minibus carrying election delegates.