The group has been declared a terrorist organisation by the government and the interior ministry spokesman told reporters on Saturday that the three-day operation "has been a success".

About two tonnes of materials used to make explosives were also seized.

The killing of the two police officers led to an angry response from security forces when Tunisian President Moncef Marzouki, Prime Minister Ali Larayedh and other senior officials attended a memorial service for the men on Friday.

The leaders were forced to leave the ceremony because of the hostility.

Ansar al-Sharia has been blamed for the murders of two secular opposition politicians earlier this year.

Their deaths also triggered mass protests against Tunisia's Islamist-led government.

Several other militant groups - including al-Qaeda in the Islamic Maghreb - also operate in the region.

But the latest clashes were significantly closer to the capital than previous fighting with suspected Islamists.

Since the popular revolt that sparked the "Arab Spring" in 2011, Tunisia has seen a rise in attacks by militants.

A coalition led by the moderate Islamist Ennahda party was elected in 2011. But some government critics accuse it of being soft on hardline Islamist forces - charges it strongly denies.