By Abdi Sheikh
MOGADISHU (Reuters) - Islamist militants rammed a car bomb into a police compound north of Somalia's capital on Tuesday and opened fire on officers, leaving at least 28 people dead, officials and witnesses said.
Al Shabaab - the al Qaeda-linked group that claimed responsibility for a deadly raid on a shopping mall in neighboring Kenya in September - said it carried out the morning assault.
Gunfire rang out at the police station in Baladweyne, near the border with Ethiopia, into the early afternoon as locals rushed for cover.
African Union (AU) peacekeepers and Somali troops surrounded the compound and opened fire. Witnesses said the shooting inside then stopped.
Seven civilians, 10 militants and 11 police officers were killed, said Somali government spokesman Abdirahman Osman - figures that were confirmed by several people at the scene.
Some witnesses said the militants blasted their way through the gate and sprayed people inside with bullets.
Colonel Dibad Osman, a spokesman for the African Union peacekeeping force in Baladweyne, told Reuters the attackers failed to blow the gate, then tried to climb inside the compound.
"Some militants died in the car explosion while others were shot dead as they jumped over the wall. The (AU) forces suffered slight injuries," he told reporters at the scene of the attack.
Al Shabaab has been driven out of many of its strongholds, including Mogadishu and Baladweyne, over the past two years. But it has kept up car bombings and guerrilla attacks.
Sheikh Abdiasis Abu Musab, al Shabaab's military spokesman, said 25 Somali policemen and 18 Djiboutian members of the country's AMISOM peacekeeping force were killed. He told Reuters many of the militants managed to get away unharmed.
The Islamists have exaggerated the number of casualties in the past, just as government officials have at times played down the dead in clashes with insurgents.
"First, a speeding car went past us and soon we heard a big explosion followed by gunfire. The car rammed into the gate of the police station. We can see a huge (plume of) smoke and hear exchange of gunfire," said shopkeeper Nur Osman at the scene.
A nurse at a hospital next to the police station said doctors and patients were taking cover.
Somali President Hassan Sheikh Mohamud condemned the attack, saying his government was determined to eliminate the Islamists.
Mohamud's elected government has been in charge for just over a year and is striving to rebuild Somalia after two decades of civil war and lawlessness triggered by the overthrow of President Siad Barre in 1991.
"I say this was a stupid attack because our enemies need to understand that these attacks do nothing to advance their cause, however misguided," the president said.
Barre's toppling plunged Somalia into turmoil, first at the hands of clan warlords and then Islamist militants, who have steadily lost ground since 2011 under pressure from the African Union military offensive.
Al Qaeda said in early 2012 that al Shabaab, which wants to impose its strict version of sharia, or Islamic law, across the country, had joined its ranks.
Last month, a bomber killed 16 people in a cafe in the same district, targeting Ethiopian and Djibouti troops who al Shabaab accuses of invading Somalia.
Straddling a major highway that links south-western Somalia to southern and northern parts of the country, Baladweyne is the main gateway to the Ogaden region in Ethiopia.
(Writing by James Macharia; Editing by Andrew Heavens)