Security forces were surrounding at least two militants in the Bardo museum in central Tunis, a venue that is often packed with foreigners, the interior ministry spokesman added.
Exchanges of gunfire first rang out from parliament around midday, TAP state news agency reported, and witnesses said large bodies of police moved in to try and evacuate the area.
Tunisia, whose 2011 uprising against autocrat Zine El-Abidine Ben Ali inspired "Arab Spring" revolts in Egypt, Syria and Libya, has up to now largely avoided the chaos and violence that has plagued those countries.
But Tunisia's armed forces have been fighting Islamist militants who emerged after the uprising.
Several thousand Tunisians have also left the country to fight for militant groups in Syria, Iraq and Libya, and the government is worried about returning jihadis carrying out attacks at home.