TUNIS, Tunisia — Dozens of militants stormed through a town in eastern Tunisia early Monday morning, attacking police and military posts and starting a firefight with security forces that left at least 53 people dead.
The clashes at Ben Gardane, 18 miles from the border with Libya, were the second in the district in a week and came at a time of growing concern that the war in Libya, where the Islamic State has aggressively expanded, was spilling into Tunisia.
The assault started just after 5 a.m. with coordinated attacks on military barracks, a national guard station and a police station, according to the Defense and Interior Ministries. The confrontation spilled into the streets, where security forces pursued and opened fire on attackers.
Several times the authorities raised the estimated death toll; by midafternoon it stood at 53. The dead included 35 militants, 10 security agents, one soldier and seven civilians.
"On this painful occasion, I would like to address the Tunisian people to say that today there was an attack against our units — military, national guard and security units — in Ben Gardane at 5 a.m.," President Beji Caid Essebsi said in a televised address. "This is an unprecedented attack. It is well organized and coordinated. The motive behind it is probably to take control over the region, and to announce a new wilayat."
The wilayat, typically translated as a province or governorate, was part of the administrative structure of the Ottoman Empire, and the Islamic State, also known as ISIS or ISIL, has used the term to refer to territory it controls.
Essebsi said that the Tunisian forces had anticipated an attack — though "probably" not one on this scale — and reacted vigilantly.
"Most Tunisians are in a state of war against this recklessness, against these rats," he said, referring to the Islamic State.
The authorities sealed the border with Libya, set up checkpoints in Ben Gardane and used bullhorns to urge residents to remain indoors as the authorities searched for other attackers.
Although officials did not identify the attackers, this was the first such assault to target a Tunisian military installation, and most suspicions pointed to militants based in Libya as being behind the raid.
Last month, U.S. warplanes killed at least 43 people in an attack on an Islamic State training camp in Sabratha, Libya, 60 miles from the border with Tunisia. The target of that airstrike was a militant commander linked to attacks on Western tourists at a museum and a beach resort in Tunisia last year.
U.S. commanders say such strikes are part of an effort to contain the spread of the Islamic State, while the United States and its allies consider a much wider campaign of airstrikes against the group in Libya.
The United States has said that about 6,500 Islamist State fighters are in Libya, many of whom are originally from Tunisia. Although most of the fighters are based along a 150-mile stretch of coastline in northern Libya, others are based in towns like Sabratha, from where they can plot attacks across the region.
In an effort to stop militant infiltration, Tunisia has built a 125-mile-long berm along half of the border with Libya. Still, tensions are rising: On Wednesday, Tunisian soldiers killed five militants in a firefight near Ben Gardane.
After the assault on Monday, the security forces said they had confiscated a large cache of weapons. The security forces also blocked nearby border crossing points at Ras Ajdir and on the island of Djerba, a tourist area that is home to a small population of Tunisian Jews.
In a statement, the Interior Ministry urged locals to remain indoors but assured them the situation was "under control."
Although militants had never targeted a military installation in Tunisia, 12 people died in a suicide attack on a bus carrying members of the presidential guard in Tunis in November.