Two car bombs killed at least seven people in Somalia's capital Mogadishu on Saturday, police said, and Islamist group al Shabaab claimed responsibility.

A suicide car bomb was rammed into a hotel, Nasahablod Two, about 600 metres from the presidential palace, and then armed militants stormed the building, police said.

A few minutes later a car bomb exploded near the former parliament house nearby.

Major Mohamed Hussein, a police officer, told Reuters seven people had been killed, including soldiers and civilians. Fighting was still raging inside the hotel and Hussein said the death toll was likely to rise.

Abdikadir Abdirahman, director of Amin ambulances, told Reuters the emergency service had carried three dead people and 17 injured from the hotel.

A huge cloud of smoke rose over the scene and a Reuters witness saw over a dozen wrecked cars and bloodstains in front of the hotel. Sporadic gunfire could be heard in the vicinity.

Islamist group al Shabaab, responsible for scores of such attacks in the country's long civil war, said it carried out Saturday's bombings.

‘We targeted ministers and security officials who were inside the hotel. We are fighting inside,’ Abdiasis Abu Musab, the group's military operations spokesman, told Reuters.

Al Shabaab is fighting to topple Somalia's internationally-backed government and impose its strict interpretation of Islam's sharia law.

Bombs in Mogadishu two weeks ago killed at least 358 people, the worst such attacks in the country's history, igniting nationwide outrage. Al Shabaab was widely suspected, but has not claimed responsibility.

Related Story