Dozens of Islamist fighters have stormed through the Tunisian town of Ben Guerdan near the Libyan border, attacking army and police posts in a raid that killed at least 53 people, including civilians, the government and residents say.
Local television broadcast images of soldiers and police crouched in doorways and on rooftops as gunshots echoed in the centre of the town on Monday. Bodies of dead militants lay in the streets near the military barracks after the army regained control.
Authorities sealed off the nearby beach resort town of Djerba, a popular destination for foreign and local tourists, imposed a curfew on Ben Guerdan and closed two border crossings with Libya after the attack.
"I saw a lot of militants at dawn, they were running with their Kalashnikovs," Hussein, a resident, told Reuters by telephone.
It was not clear if the attackers crossed the border, and no group immediately claimed responsibility. But it was the type of militant operation Tunisia's government has feared as it prepares for potential spillover from Libya, where Islamic State militants have gained ground.
"This attack was an unprecedented, well-organised. They wanted to try to control the Ben Guerdan region and name it as their new Wilaya," President Beji Caid Essebsi said, referring to the name Islamic State uses for regions it considers part of its self-described caliphate.
Soldiers killed 35 militants and arrested six, the Interior Ministry said. Hospital and security sources said at least seven civilians were killed along with 11 soldiers.
Troops also later discovered a large cache of rifles, explosives and rocket-propelled grenades in Ben Guerdan, a security source said.
"If the army had not been ready, the terrorists would have been able to raise their flag over Ben Guerdan and gotten a symbolic victory," said Abd Elhamid Jelassi, vice president of the Islamist party Ennahda, part of the government coalition.
Islamist militant gunmen trained in Libyan camps carried out two of the three major attacks on Tunisia last year, including assaults on the Tunis Bardo museum and a Sousse beach hotel targeting foreign tourists.