Seven suspected terrorists were also arrested after the attack in the town of Ben Gardane, the ministry statement said.
Air patrols in the area around the border have intensified, and the main crossings with Libya -- Ras Ajdir and Dheiba -- were closed Tuesday.
Authorities asked residents in Ben Gardane to stay indoors and report any suspicious activity.
Human rights activist Mustapha Abdelkebir in Ben Gardane told CNN that a senior counter terror official -- his relative -- was among the dead.
The Tunisian interior ministry also released photographs of three people it identified as prominent ISIS militants who it said were killed in the attacks and subsequent police raids. The ministry did not give their names.
Terrorists, some of them from ISIS
, have waged brutal attacks on Tunisia in recent years, including on Tunis' Bardo museum
and a seaside resort in Sousse
Tunisian President Beji Caid Essebsi denounced what he called the "unprecedented and coordinated" militant attack on the barracks, and suggested it may have been an attempt to control the region and "proclaim a new province."
He also vowed to eradicate his country of terrorists.
"The vast majority of Tunisians are at war against this barbarism and those rats that we will definitely exterminate," Essebsi said.
Those acts have hurt Tunisia's economy by deterring tourists from visiting, and economic hardship has in turn provoked popular unrest in the North African nation.
Large-scale demonstrations over a lack of jobs and abundance of poverty led the Interior Ministry to introduce a nationwide 8 a.m.-to-5 p.m. curfew for two weeks at the end of January.
Protests over scarce jobs and an ineffective government also drove similar unrest five years ago and spurred authoritarian President Zine el Abidine Ben Ali to flee in January 2011, making Tunisia
the first of what would become several nations in the Arabic-speaking region in North Africa and the Middle East where popular uprisings led to the ouster of longtime leaders.
Turmoil followed in other countries such as Libya and Egypt that were also caught up in what was called the Arab Spring
, while protests in Syria spiraled into a bloody civil war
that still rages today.
Tunisia, though, had long been hailed as the exception. Its "Jasmine Revolution" was marked by a relatively peaceful political transition and inclusive government.