MOGADISHU, Somalia — Attackers from the Shabab militant group assaulted a police station in a Somali town north of Mogadishu on Tuesday, leaving at least 28 people dead and scores more wounded.

Witnesses said a Toyota pickup truck tried to pass through the gate of a police station in the town of Beledweyne, near the Ethiopian border, but the truck was blocked by African Union forces. The attackers then detonated explosives inside the vehicle.

After the explosion, witnesses said, armed Shabab fighters entered the station and engaged in a shootout with the police. A Somali government spokesman, Abdirahman Omar Osman, said that in all, 11 officers and 7 civilians were killed in the attack, along with 10 militants who died either in the explosion or in the ensuing gun battle.

A spokesman for the Shabab claimed responsibility for the attack. Just two months ago, the group said it was behind the deadly siege at the Westgate shopping mall in the Kenyan capital, Nairobi, which left more than 60 people dead and thrust the Somali militants back into focus as a dangerous, cross-border threat.