Armed group al Shabab claims responsibility for the double car bombing close to the presidential palace in capital Mogadishu.
Somali security forces shot dead three attackers and foiled an attempted al Shabab attack on the presidential palace in the capital, a police officer said on Saturday.
Six people were dead in all including a suicide car bomber, Captain Mohamed Hussein told the Associated Press news agency, adding the situation had calmed and security in the area was being tightened.
The midday attack began when a car bomb detonated near a checkpoint close to the presidential palace after security forces engaged with gunmen.
A second car bomb exploded in the same area shortly afterward, Hussein said.
Second attack in a week
The attack came a week after a similar one on the interior ministry compound in Mogadishu killed at least nine people.
The Somalia-based al Shabab group, an arm of Al Qaeda, often targets high-profile places in the capital.
It claimed responsibility for Saturday's attack, saying its fighters were conducting a "major operation" around the palace and nearby SYL Hotel.
The group was blamed for the October truck bombing in Mogadishu that killed more than 500 people in the deadliest attack in the country's history.
The threat from what has become the deadliest group in sub-Saharan Africa has hurt efforts to strengthen Somalia's fragile government and stabilise the long-chaotic Horn of Africa nation.
US military mission
The US under the Trump administration has stepped up military mission in Somalia, including dozens of drone strikes, against al Shabab and a small presence of fighters linked to the Daesh group.
At least two US military personnel have been killed.
The US military and others in the international community have expressed concern about the plan for Somalia's security forces to take over the country's security from a multinational African Union force over the next few years, saying the local troops are not yet ready.
Al Shabab has been fighting to overthrow the internationally-backed government in Mogadishu for over a decade.
Despite losing towns and territory in recent years the group continues to carry out regular bombings and armed raids on government, security and civilian targets in the capital and elsewhere.