Seven Islamist militants and a Tunisian policeman were killed in a gun battle after police raided a house in Tunis where weapons, explosives and suicide bomb belts were found, a security source said.
The clash broke out late on Monday when police surrounded a house in Raoued, a northern suburb of the capital, in an attempt to arrest a group of suspected militants hiding there.
"They had suicide bomb belts and explosive material and they were well-armed," Interior Ministry spokesman Mohamed Ali Aroui said, without naming the group to which the men belonged.
Raoued is a poor district close to luxury beach resorts just outside the capital. Heavily armed counter-terrorism police patrolled near the whitewashed house where the fighting took place, its outer wall pockmarked with dozens of bullet holes.
Since last year, Tunisian armed forces have cracked down on the hardline Islamist Ansar al-Sharia faction, which Washington has listed as a terrorist organisation and whose leader has declared allegiance to Al-Qaeda.
Tunisia formally celebrates a new constitution on Friday, with French President Francois Hollande and other dignitaries invited to the ceremony to mark the North African country's progress to democracy.
Three years after its uprising inspired revolts across the Arab world, Tunisia is led by a new caretaker government that took over after the moderate Islamist Ennahda party stepped down in a compromise to end a political crisis.
The threat of Islamist militancy is among the new government's main challenges. A suicide bombing at a beach resort late last year - the first such attack in a decade - underscored Tunisia's vulnerability to jihadi violence.
Tunisian militants have used the turmoil in neighbouring Libya to get weapons and training. Some have travelled to Syria to fight for Islamist rebel groups in the civil war there.