At least five people were killed when a car bomb exploded close to the presidential palace in Somalia's capital Mogadishu on Monday, police said.

There was no immediate claim of responsibility from the Islamist militant group al Shabaab, which is trying to overthrow President Hassan Sheikh Mohamud's Western-backed government.

The group stepped up attacks this month, retaking a town in the central region and attacking African Union troops.

"So far, we know five soldiers died and over a dozen were wounded," Ali Hussein, a police officer, told Reuters, adding that the attack might have been aimed at a United Nations convoy that left the palace just before the blast.

Ahmed Aden, a resident in the area, said he had heard a loud blast followed by gunfire.

A Reuters reporter saw damage to the gate of the compound, and five burnt-out cars at the scene.