At least five people were killed and 21 wounded on Saturday when militants from Somalia's al Shabaab group set off two bombs in central Mogadishu and stormed a government building.
A Reuters witness saw a heavy exchange of gunfire outside the building, which houses the security and interior ministries and is also used by police.
Smoke drifted from burning vehicles following a suicide car bombing close to the presidential palace and a second blast near the security building.
"So far we carried (out) five dead people and 21 others injured. The death toll may rise," Abdikadir Abdirahman, director of the Amin ambulance emergency service told Reuters.
The military operations spokesman for the Islamist group, Abdiasis Abu Musab, said it had carried out both bombings and its fighters remained inside the government security building.
He said they had killed over 20 interior and security ministries' workers and security personnel who were guarding the building. Al Shabaab typically gives death tolls that are higher than numbers given by officials.
Police official Major Mohamed Hussein said the second explosion took place when a vehicle carrying al Shabaab fighters to storm the building after the first explosion was detonated remotely.
"Al Shabaab remotely exploded the second car after they got out of it," he said, adding that a heavy exchange of fire continued at the occupied building.
Al Shabaab wants to topple Somalia's Western-backed central government, expel the African Union-mandated peace keeping force AMISOM and establish a government based on its own strict interpretation of Islamic sharia law.
In a separate incident on Saturday, a roadside bomb killed a former district commissioner in the Lower Shabelle region and wounded three others, according to police. Al shabaab also claimed responsibility for that attack.
Somalia has been gripped by violence and lawlessness since the toppling of dictator Mohamed Siad Barre in the early 1990s.