A car bomb exploded outside the Somali president's palace in Mogadishu, killing five people and damaging two hotels, police officials said.

"A suicide car bomb exploded outside the presidential palace. So far two hotels opposite the palace are partially destroyed," Major Mohammed Ali said.

According to Reuters, a huge cloud of smoke could be seen rising above the president's residence. "There was a blast close to the SYL hotel area, near the main checkpoint of the presidential palace," another security officer said.

"So far we know five government soldiers died in the blast. It exploded outside the SYL hotel which is also just at the checkpoint outside the palace. We believe the target was SYL which is frequented by officials. The death toll may rise," Colonel Abdikadir Hussein explained.

Al-Qaeda affiliated al-Shabaab has claimed responsibility for the attack via the Andaluz radio broadcast. The militant group has claimed many such attacks in the recent past in Mogadishu, including a car bomb and gun attack at a beach restaurant which killed 10 people last week.

The militant group was pushed out of Mogadishu in 2011 by the African Union Peace Keeping Mission (Amisom), but have continued to remain a serious threat by launching regular attacks that are aimed at over throwing the Western-backed government.