Tunisia's prime minister has announced a crackdown on networks recruiting people to fight jihad abroad and on imams who incite violence, after 14 soldiers were killed in one of this country's deadliest attacks in recent years.

An extremist group believed linked to al-Qaida's North Africa arm claimed responsibility for the attacks on two army posts on Mount Chaambi on Wednesday night during a Ramadan feast.

Prime Minister Mehdi Jomaa said in a televised address Thursday night that the attacks were aimed at discrediting "open and tolerant Tunisia" and derailing its transition to democracy. Tunisia overthrew a dictator in 2011 and unleashed the Arab Spring uprisings.

Jomaa said authorities will strengthen border controls and measures against networks that have recruited large numbers of Tunisians to fight in Syria and Iraq.