Somalia's al Shabaab Islamist group rammed a military base with a suicide truck bomb, shot dead an intelligence officer and killed 12 people in a Kenyan border town in a series of strikes over 24 hours, the militants said on Tuesday.

The group, which once ruled much of Somalia, wants to topple the Western-backed government in Mogadishu and drive out African AMISOM peacekeepers made up of soldiers from Kenya, Djibouti, Uganda, Ethiopia and other African nations.

The attacks mark the build up to elections in coming weeks for the Somali parliament, which will in turn pick a new president to continue slow reconstruction efforts in a nation racked by more than two decades of conflict.

An al Shabaab spokesman said the group shot senior intelligence officer Colonel Abdiasis Araye as he walked to a mosque late on Monday in Mogadishu.

Spokesman Abdiasis Abu Musab also said al Shabaab was behind Tuesday's early morning attack on a hotel in Kenya's northeastern Mandera town, killing at least 12 people according to police and 15 people according to al Shabaab's account.

The group then said it drove a truck bomb into an AMISOM base in the Somali town of Beledweyne, north of Mogadishu. Al Shabaab and police did not give casualty figures.

Al Shabaab's usual tactic is to ram the entrance to a target site so that its fighters can storm inside, but a police officer in Beledweyne said no such assault took place on Tuesday.

AMISOM has been battling the rebels in support of the Somali government.

Al Shabaab has often launched attacks in neighboring Kenya, saying it will continue until Kenyan forces were withdrawn.

Kenya's government has repeatedly said it would not be forced out of Somalia by al Shabaab, saying it sees the mission as a matter of national security.