A Tunisian soldier opened fire at a military base in the capital on Monday, killing seven colleagues and wounding 10 others before being shot dead himself, according to the army which said the shooter had "family problems".
What exactly triggered the shooting at the Bouchoucha base in Tunis was not immediately clear but the incident alarmed residents in the capital city still on edge after an attack in March by Islamist gunmen on the Bardo national museum.
When gunfire erupted on Monday morning, police evacuated a nearby school, as locals feared they may be under attack.
"A soldier opened fire and killed seven others, he was then killed. Ten others are injured," army spokesman Bel Hassen Ouslati told reporters.
"According to what we know, he had some family problems, this is nothing to do with a terrorist attack."
Two military helicopters hovered over the scene as police searched cars on the road to the base. An army colonel was among the victims, a security source said.
Since its 2011 uprising against autocrat Zine El-Abidine Ben Ali, Tunisia has been spared from the worst chaos that neighbouring countries experienced after the "Arab Spring". However, some Islamist hardliners have turned to violence.
Tunisian forces have been carrying out operations against Islamist fighters since March when two gunmen opened fire on tourists at the Bardo museum, killing 21 foreigners in the one of the worst attacks in Tunisia in more than a decade.