The Somalia-based extremist group al-Shabab is claiming responsibility for the twin blasts in Mogadishu that have killed at least 18 people and injured 20 others.
The group wants to overthrow the Somali government and impose its own harsh interpretation of Islamic law.
The second came close to parliament, the presidential palace and police headquarters - all of which are in close proximity to each other in Mogadishu's government district.
The streets around the palace and near the new hotel were surrounded by security forces who denied access to ambulances and reporters.
The latest attack comes just a day after the ministry of national security warned Mogadishu residents to be vigilant because an attack could be imminent.
Mohamed Yusuf, Director of Madiina Hospital where many of the dead and injured were taken, said most had been killed in the first car blast. "The forces were pursuing the vehicle as it headed towards the palace but exploded before reaching the target", Abdulle told Xinhua.
A police officer, Ahmed Abdulle, told Xinhua that security forces manning the presidential palace repulsed militants who were trying to storm into the palace, killing three of them. The second blast took place beside a popular hotel.
Al-Shabaab claimed responsibility for the attack via its radio arm, Andalus.
In October, more than 500 people were killed when a suicide bomber detonated a truck full of explosives in the capital.
The explosions shattered a months-long period of calm in Mogadishu, which is often the target of attacks by al-Shabab. The United States was the biggest participant with 6,125 soldiers, followed by hosts Thailand, who sent 4,007 troops to the drills.
Al-Shabaab said its attackers had killed 35 soldiers and five of its fighters were also killed.