Tunisia: Knife attacker wounds two policemen outside synagogue
The man had been imprisoned over a "terrorism" case and released in 2021, interior ministry spokesman Fakher Bouzghaya told AFP.
The suspect assaulted police deployed to guard the Grand Synagogue of Tunis in the city centre, lightly wounding two officers before being overpowered.
Bouzghaya said an investigation was underway.
Before its independence from France in 1956, Tunisia was home to over 100,000 Jews, but emigration has seen their numbers fall to around a thousand.
Since the revolution that overthrew dictator Zine El Abidine Ben Ali in 2011, the country has seen a number of jihadist attacks that have killed dozens of people.
The latest attack comes with the country in a deep economic and political crisis almost a year since President Kais Saied's July 2021 power grab.