Since the fall of Ben Ali, there has been a rise not just in moderate Islamist groups but also hardline ultraorthodox Muslims known as salafis, who have railed against what they call the secular elements of a country long known for its progressive attitudes, especially concerning women's rights.
Critics of the government say these salafi groups, including those advocating violence, have been allowed to run rampant. On Sept. 14, several salafi groups converged on the U.S. Embassy, burning cars and destroying a nearby American school. Seifallah Ben Hassine of the Ansar al-Sharia group, a former denizen of Ben Ali's jails, has gone into hiding after being linked to the embassy attack.
In February, a leftist politician, Chokri Belaid, was assassinated and the men eventually arrested were described as being linked to salafi groups.
The attacks sent the country's delicate political transition into turmoil, prompting then-Prime Minister Hamadi Jebali to resign in February and raising fears that the Ennahda-led government was failing not only at the economy but security as well.
"The terrorist threat has moved to a higher level," Jebali said in a recent interview with the French-language daily La Presse. "The top priority is to launch a decisive campaign to recover all the weapons circulating in the country."
He added that the country is still in the delicate process of writing a new constitution and holding elections for a new legislature and president, by the end of the year. The process has been riven by angry disputes between Ennahda and the opposition parties, partly over Ennahda's alleged laxity towards salafis.
"Please don't add political and social landmines to those already on Jebel Chaambi," said Jebali, calling for national unity in face of the threat.
Part of the problem is the hundreds of mosques under control of radical preachers that are filling disaffected youth in the impoverished interior with ideas of jihad, whether at home or abroad. A third of the 32 attackers against an Algerian gas facility in January were Tunisian and there are reportedly hundreds fighting in Syria.
Alaya Allani, an expert on North African Islamist movements, estimated that some 500 of 4,000 mosques are outside state control — several times the number the government has acknowledged.
"For now the warning light is orange but it risks turning red if the appropriate measures are not taken," he said, recommending a national conference of all political parties to forge a common anti-terrorism strategy.
But Riccardo Fabiani, the North Africa analyst of the London-based Eurasia group, said that some of the alarm over the recent attacks has been overblown when taken in a broader regional context.
"If we compare the situation in Tunisia to the rest of the region, particularly Libya and Algeria, it is pretty much under control," he said, adding that state and foreign interests were not under any significant threat.
He said that part of the problem is how demoralized security forces have been since the fall of Ben Ali, sapping their ability to maintain border security as well as in the past.
"They are countering the problem with limited resources and security forces are downbeat," he said. "They feel powerless."
Schemm reported from Rabat, Morocco.