TUNIS — Tunisia has sent more fighters abroad to join the ranks of the Islamic State than any other country. And now, as the Islamic State takes a battering on the battlefields of Syria and Iraq, the country is at odds over what to do if and when they come home.

Tunisians have been dealing with a frenzied polemic in recent weeks, as secularists have raised fears that a returning wave will bring further mayhem to this fragile state and Islamists have been forced to condemn the jihadists.

“How can we accept those people who are professionals in war, in the use of arms and have a culture of being terrorists?” asked Badra Gaaloul, a civil-military analyst who heads the International Center of Strategic, Security and Military Studies. “We in Tunisia are in crisis, and we cannot accept these people.”

“It is a nightmare for Tunisia,” she added. “We are not ready for that.”

The concern is not academic. Ms. Gaaloul, among others, points to the experience of Algeria, which suffered through a decade-long insurgency in the 1990s when jihadists returned from Afghanistan set on establishing Islamic law, and the army led a brutal war to crush them.