Militants attacked army and police posts in the Tunisian town of Ben Guerdane near the border with Libya early on Monday, clashes killed at least seven civilians, 11 security officers and 35 militants, officials said.
The Interior Ministry said six militants were also arrested after the attack, while authorities imposed a curfew from 19:00 to 05:00 local time in Ben Guerdane.
The Interior Ministry warned people to stay in their homes as gunfire erupted in the centre of the southern town during the early morning attack.
Authorities sealed off the nearby beach resort town of Djerba, a popular destination for foreign and local tourists, according to TAP state news agency.
Tunisian President Beji Caid Essebsi denounced Monday's militant attacks on police and army posts near his country's border with Libya as "unprecedented" and coordinated assaults.
The assault in which 35 militants were killed was "maybe aimed at controlling" the border region with Libya, said Essebsi and vowed to "exterminate these rats."
Tunisia has built a trench along its border, worried about spillover from Libya where DAESH terrorists are expanding, and Western military advisers are training Tunisian border forces.
Militants trained in camps across the border in Libya carried out several attacks in Tunisia last year, including the attacks on the Tunis Bardo museum and a Sousse beach hotel targeting foreign tourists.
More than 3,000 Tunisians have left to fight with DAESH and other groups in Syria and Iraq. Tunisian security officials say they are returning to join the militant group in Libya over the border.
Since the fall of Muammar Gaddafi five years ago, Libya has slipped into chaos, with two rival governments and armed factions struggling for control. DAESH has grown in the turmoil, taking over Sirte city and drawing foreign recruits.
Tunisian forces have been on alert for possible infiltration since last month when a US air strike targeted mostly Tunisian DAESH terrorists at a camp near the border in Libya's Sabratha.
Western military advisers are starting to train Tunisian border forces to help better protect the frontier with electronic surveillance and drones and authorities have built a trench and barriers to help stop militants crossing.