The Tunisian Interior Ministry imposed a curfew in the southern city of Begardene near the border with Libya on Monday after clashes between unidentified insurgents and security forces left 26 dead.
The curfew was scheduled to begin at 7 pm local time (1800 GMT) and end at 5 am (0400 GMT) on Tuesday, the Interior Ministry said in a statement.
Six terrorist suspects were arrested and 21 killed during the clashes, which broke out at dawn, according to a joint statement by the Interior and Defence Ministries.
The fighting began when gunmen attempted to storm military barracks in Begardene, leading to clashes between them and the security forces, Tunisian Defence Ministry spokesman Belhassen Oueslati said.
One soldier and four civilians were also killed in the crossfire.
An operation has been under way to hunt down the militants who managed to flee the scene. Security forces have blocked all roads leading to the city.
Joint army-police patrols have been deployed in the city with assistance from the air forces, the state-run Agence Tunis Afrique Presse reported.
The authorities closed the Ras Jedir border crossing with Libya as well as Djerba Island, a tourist destination, in Begardene to prevent the infiltration of militants, the agency said.
The Interior Ministry called on Begardene residents to remain inside their homes and asked reporters not to go to the city, the report added.
Meanwhile, Tunisian Prime Minister Habib Essid called for an emergency meeting with the Interior and Defence ministers to discuss developments, a cabinet statement said.
On Wednesday, Begardene was the scene of deadly clashes between security forces and Islamist militants who had reportedly sneaked in from Libya.
Tunisia has experienced a series of deadly attacks during the past year.
In November last year, Tunisian President Beji Caid Essebsi declared a state of emergency throughout the country after an attack by a suicide bomber on a bus carrying presidential guards claimed the lives of 12 people.
The Islamic State terrorist group, which is active in Libya, has claimed responsibility for some of the attacks, including a gun attack that killed 21 tourists and a policeman at the Bardo museum in the heart of the capital Tunis.
Last month, Tunisia completed a sand barrier and trench running half the length of its border with Libya. Work on the barrier began after 38 tourists were killed in a rampage by a lone gunman in a beach resort in Sousse, south of the capital, Tunis, in June last year.
Libya has been beset by instability since the overthrow in 2011 of dictator Moamer Gaddafi.