A bombing claimed by the al-Qaeda-linked al-Shabab group has killed eight people and injured 15 more in the Somali capital, according to a spokesman for Mogadishu's mayor.

Bombings are a near-daily occurrence in Mogadishu. Most are claimed by al-Shabab, an armed group that is fighting to overthrow the UN-backed government and drive out the African Union peacekeeping force that supports it.

"We have confirmed that five civilians, including a mother and her son, have died," said Abdifatah Omar Halane, spokesman for the Mogadishu mayor, referring to Wednesday's bombing.

A Reuters news agency reporter at the scene saw burned bodies and a wrecked car near a damaged police checkpoint outside a restaurant near Mogadishu's port.

OPINION: From a fishing village to al-Shabab's most wanted

A spokesman for al-Shabab's military operations admitted that one of the group's fighters was killed in the incident.

"One mujahed [fighter] was martyred after he targeted security officials with his car bomb," Sheikh Abdiasis Abu Musab told Reuters.

Since withdrawing from Mogadishu in 2011, al-Shabab has lost control of most of Somalia's cities and towns. But it still retains a strong presence in parts of the south and centre.

Somalia's government recently declared a new offensive against al-Shabab, which has targeted military facilities, hotels and the presidential palace in recent months in Mogadishu.

Also on Wednesday, eight Kenyan security officers were killed on the Kenyan side of the Somali border in two separate roadside bombings.

Al-Shabab claimed responsibility for the first attack but could not be reached for comment on the second.

Adding to the violence, a small armed group in the north of Somalia has split from al-Shabab's campaign and declared allegiance to the Islamic State of Iraq and Levant (ISIL, known as ISIS) group.

That group claimed responsibility for a bombing in the northern city of Bosasso that killed five people on Tuesday.

Somalia has been mired in civil war since 1991. It is also suffering from a regional drought that threatens to tip its population of 12 million into famine.