A raid by Tunisian security forces on an armed group near the capital Friday left six suspected militants dead, including five women, fanning tensions days ahead of a landmark election.
Tens of thousands of soldiers and police will be deployed for Sunday's parliamentary polls -- the first since an uprising three years ago that inspired the Arab Spring revolutions.
The authorities have expressed fears that "terrorists" will seek to disrupt the vote.
Islamists suppressed under former strongman Zine El Abidine Ben Ali have proliferated since his overthrow in 2011.
Militants have been blamed for a wave of attacks, including last year's assassination of two leftist politicians whose murders plunged the country into a protracted political crisis.
A gunman was among the dead in Friday's raid on a house in a suburb of Tunis, while another was hospitalised along with two children, interior ministry spokesman Mohamed Ali Aroui told reporters at the scene.
He said one of the children, a girl, had suffered a head injury, without elaborating.
Authorities had earlier demanded that the children and women be allowed to leave the house, giving the gunmen an ultimatum to surrender.
"Special forces approached the kitchen where the terrorists were hiding," Aroui said.
"The women came out of the kitchen firing," he added, describing both the men and women at the house as "terrorists".
He did not say whether the suspects were thought to be an isolated cell or part of a larger group.
Militants claiming allegiance to Al-Qaeda's north African affiliate have been active in Tunisia since the 2011 revolution.
The house in Oued Ellil was surrounded on Thursday following the arrest of two other suspected militants in Kebili, 500 kilometres (300 miles) south of the capital.
A policeman was killed the same day in a firefight with the suspects in Oued Ellil and another was wounded.
- Campaigning wraps up -
Signup to our newsletter and follow us on Facebook and Twitter!
The operation in the suburb was launched based on information extracted from the two suspects detained in Kebili for killing a private security guard, the authorities said.
Tunisia announced a three-day closure from Friday of the border with politically unstable Libya for fear of possible election day attacks.
The polls are seen as crucial to restoring stability in the North African nation, the cradle of the Arab Spring revolutionary movements.
Political parties were wrapping up campaigning on Friday while Tunisians overseas began voting.
The vote will be followed by a presidential election on November 23.
Jihadists have killed dozens of soldiers and police over the past three years, especially in remote mountain areas on the Algerian border.
- Plots foiled -
On Monday, Interior Minister Lotfi Ben Jeddou said the authorities had foiled plots to bomb factories and attack foreign missions.
Rached Ghannouchi, leader of Tunisia's moderate Islamist movement Ennahda, told AFP the country's transition to democracy served as an example of how to defeat extremists such as the Islamic State (IS) organisation.
"The success of the Tunisian experience is in the international interest, especially in the fight against extremism and the fight against Islamic State and similar groups," he said.
"One of the best ways to fight terrorism is to advocate moderate Islam because terrorism is based on an extremist interpretation of Islam," said Ghannouchi, whose party has emerged as the leading political force in Tunisia since the fall of Ben Ali.
Sunday's election pits Ennahda against an array of secular groups, including Nidaa Tounes, whose leader Beji Caid Essebsi has criticised Ennahda as anti-democratic.
In recent weeks, a US-led military coalition has conducted daily air strikes against IS, which has proclaimed an Islamic "caliphate" across swathes of Iraq and Syria, carrying out beheadings and other atrocities.
Between 2,000 and 3,000 Tunisians are reported to have gone to join IS and other extremist groups fighting in Syria and Iraq.
Tunisian authorities fear some will return to destabilise the country.