The operation is ongoing, an interior ministry spokesman told AP news agency.
Tunisia has declared a state of emergency after 38 tourists were killed in an attack by an Islamist gunman in the beach resort of Sousse on 26 June.
Thousands of British tourists have left the country after a new travel alert from the UK foreign office.
It said that another terror attack in the country was "highly likely" and urged Britons to leave.
Other countries like Germany and France, however, have not followed suit.
France, which accounts for the largest number of tourists in Tunisia, says its nationals should be "particularly vigilant" but has stopped short of telling them to leave.
Germany said it was sending a team to assess the security situation in Tunisia in the next few days.
Source: Tunisian national institute of statistics
Officials have not suggested there is a link between the mountain operation and the June attack.
The army has been trying to dislodge militant groups from the mountains near the border with Algeria for several years.
Military helicopters have been pursuing other suspects as part of the operation being led by the Tunisian army and national guard, an unnamed security source told Reuters news agency.
It is not clear which group the militants killed in the operation belong to.
The Sousse gunman has been identified as student Seifeddine Rezgui, who authorities say had trained in Libya.
Tunisian Prime Minister Habib Essid told the BBC that Rezgui had probably trained with the Ansar al-Sharia group, though Islamic State (IS) earlier said it was behind the attack.
Live news updates from Africa

The 16-year-old was in woodland, between Howitts Lane and Howitts Gardens, in St Neots, at about 17:30 BST, when he came off his bike.
He suffered serious injuries to his neck and wind pipe, Cambridgeshire Police said.
He was rushed to Addenbrooke's Hospital where he remains in a serious but stable condition.
Det Con Diane Tomlinson said: "The young man is in a serious condition in hospital and I would like to speak with anyone who may know why the rope was tied to those trees, or who may have put it there.
"Anyone who uses the area, such as dog walkers, who may have information, no matter how insignificant it may seem, should call police."
Tunisian security forces have killed five suspected Islamist militants in the mountains near the central town of Gafsa, officials say.
[NEXT_CONCEPT]
A teenage motorcyclist was seriously injured when he came off his bike after hitting a rope tied between two trees.