An official says militants have attacked an army post in northeastern Somalia, killing 12 soldiers in one of the deadliest attacks in recent months by the al-Qaida-linked group.

The attack occurred in Galgala Mountains, in the semiautonomous Puntland region, where al-Shabab militants are trying to expand their influence.

A Puntland official, who insisted on anonymity because he is not authorized to speak with the press, said Wednesday that militants attacked the post and blew up a roadside bomb on Tuesday night, killing the soldiers.

Al-Shabab militants have been pushed out of their key strongholds in southern and central Somalia by African Union forces. The Somali government says the militants are consolidating in Galgala.