By Abdi Sheikh and Feisal Omar

MOGADISHU (Reuters) - 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.

Al Shabaab spokesman Abdiasis Abu Musab said the group was behind a truck bomb that rammed into an AMISOM base in the Somali town of Beledweyne, north of Mogadishu. He said 17 soldiers from Djibouti were killed.

AMISOM, which is battling the Islamist rebels in support of the government, said a vehicle packed with explosives was set off at the base and 10 suspected al Shabaab militants attacked. "The terrorists were all killed," it said on Twitter.

"Reinforcement from a nearby base was rushed to the camp and the situation swiftly brought under control," AMISOM added.

Al Shabaab, whose assessment of casualties often varies from those of officials, typically rams the entrance to a target site with a car or truck bomb so that its fighters can storm in.

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

He 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.

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.

(Additional reporting by George Obulutsa in Nairobi; Writing by Edmund Blair; Editing by Andrew Heavens and Raissa Kasolowsky)