* Threat follows Puntland's execution of 13 alleged rebels
* Once calm autonomous region now vulnerable to al Shabaab
Al Qaeda-linked Somali militants who have dug into parts of the northern Puntland province pledged vengeance after authorities in the autonomous region executed 13 suspected Islamist rebels.
Puntland long avoided being caught up in successive Islamist insurgencies that have shattered Somalia but has slowly been infiltrated by al Shabaab rebels squeezed out of former south-central urban redoubts in the Horn of Africa state.
Puntland officials say many of the insurgents have taken up positions in the mountains west of the port city of Bosasso.
"Puntland massacred innocent Muslims," al Shabaab spokesman Sheikh Ali Mohamud Rage said in an audio recording posted late on Tuesday on www.somalimemo.net, a website linked to the rebel group. "We shall avenge them. All those who spied, bore false witness, judged, and shot them will face a tough punishment."
Wary of a reprisal attack, Puntland security forces later deployed heavily in Bosasso's dusty streets. The suspected insurgents were shot dead early on Tuesday outside Bosasso.
A military court official in Puntland said they had confessed to being militants. Al Shabaab denied that any of its fighters were in detention in Puntland.
Rage said the deaths resembled a string of apparent extrajudicial killings in Mogadishu last month, when residents said government security forces had killed at least 10 pardoned al Shabaab fighters and dumped their bodies in the streets.
The Mogadishu government has promised to investigate those killings. They followed the murder of two senior security officials, for which al Shabaab claimed responsibility.
Somalia is trying to emerge from two decades of civil war that has left it without an effective central administration.
Security has improved in Mogadishu and the government sees bolstering the rule of law and reforming the judiciary as crucial to restoring normality.
African Union military intervention has done much to dislodge al Shabaab from its southern and central strongholds, setting back their bid to impose their strict brand of sharia (Islamic law) on Somalia.
But an attack on Mogadishu's law courts in March that killed 30 people showed al Shabaab can still launch strikes in government-held areas despite its decline as a fighting force.