At least 13 suspected militants were killed Monday in clashes between Tunisian security forces and unknown insurgents near the border with Libya, Tunisian Defence Ministry spokesman Belhassen Oueslati said.
Gunmen attempted to storm military barracks in the Tunisian border town of Begardene, Oueslati added.
Security sources said that four civilians and one soldier were also killed in the crossfire.
Two suspects have been arrested, while an operation is under way to hunt down the militants who managed to flee the scene. Security forces have blocked all roads leading to the city.
Local media reported that the authorities closed the Ras Jedir border crossing with Libya as well as Djerba Island, a tourist destination in Begardene.
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 over the past year.
The Islamic State terrorist group, which is active in Libya, has claimed responsibility for some of them, 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.
Libya has been beset by instability since the overthrow in 2011 of dictator Moamer Gaddafi.