Interior ministry spokesman Mohamed Ali Aroui told journalists that the attack involved "two or more terrorists armed with Kalashnikovs".
In 2002, 19 people, including 11 German tourists, were killed in a bomb blast at a synagogue in the resort of Djerba. Al-Qaeda said it had carried out that attack.
Concerns about security in Tunisia have increased in recent months as neighbouring Libya has become increasingly unstable. A large number of Tunisians have also left to fight in Syria and Iraq, triggering worries that returning militants could carry out attacks at home.