SHAFAQNA – Aymen Arbaoui told his family he would be gone for just a few weeks. He was only 17, but was already a dab hand at interior decorating. The young Tunisian heard there was casual work going in Libya. He’d be back in time for school in January.

Six months later, his family learned the truth from a jihadi website: he had been killed in Syria on 2 June, fighting with Islamic State (Isis).

“He was a quiet boy,” his mother, Mbaraka Arbaoui, says. “He just studied and he got good marks, especially in mathematics.”

The family say they do not believe any organisation was involved in his decision to travel to Syria. He was most probably influenced by a couple of books he had acquired from a Saudi-based religious scholar, they say.

He is also part of a trend. Though Tunisia is in many senses the most advanced and secular of Arab states – and the only country to have come through the revolutions of 2011 relatively unscathed – that is only half the story. According to some estimates, there are more Tunisians among foreign jihadis fighting in Syria and Iraq than from any other single country.

The Tunisian interior ministry itself estimates that at least 2,400 of its citizens have become combatants in Syria since 2011, and that around 400 have returned. Several thousand more have been prevented from travelling, it says, and there has been an attempt to close down the recruitment networks. The well-worn routes led through Tunis airport, especially flights to Istanbul, or across the southern land border, via Libyan training camps.

In Douar Hicher, a poor district at the edge of Tunis, it is common knowledge that 40 or 50 young men have left to fight and perhaps a dozen have been killed.

The same neighbourhood contributed four “martyrs” to the 2011 revolution that ousted long-time dictator Zine al-Abidine Ben Ali. Since then, amid a general loosening of the control of the state, radical Islam has moved into the mosques and an overexcited free-for-all has overtaken the internet and social media now that censorship has ended.

In Douar Hicher it was Ansar ash-Sharia (followers of sharia) that began to build up support in the local mosque – and on its local Facebook page. Publicity videos showed members striding into impoverished rural homes carrying boxes of groceries along with copies of the Qur’an.

Its leader, a Tunisian who had spent time fighting in Afghanistan, Seifallah Ben Hassine (also known as Abou Iyadh), was careful not to advocate jihad at home. But some locals maintain it was Ansar ash-Sharia that recruited young men of the neighbourhood for jihad in Syria.

Not all Tunisian participants in the conflict in Syria and Iraq are drawn from poor parts of town. Omar (not his real name) is a graduate and son of a senior civil servant. His father did not manage to help him get a civil service job, but in 2012 he found a role – and camaraderie – with Annasiha, a Gulf-funded group that had moved into Tunisia to carry out “dawa”, or preaching activities, through public rallies, advocating a more literal interpretation of Islam and distributing Saudi-printed literature on the minutiae of religious observance.

The 25-year-old also spent a lot of time on Facebook, viewing video clips showing Muslims suffering worldwide, from the Rohingya in Burma to civilians in Syria. He befriended a Syrian man on Facebook who told him he would be very welcome to join the fight against Bashar al-Assad.

Omar paid his own fare to Istanbul, using cash he had collected as rent from tenants in a couple of flats owned by his father. It was his first trip out of Tunisia. From Istanbul he took a bus south, and forked out for a Kalashnikov, which he would later lose in a hasty retreat from one of Assad’s tanks. He says he received little military training. “We were supposed to retreat from one tree, or bit of cover, to another,” he recalls. “Me, I’d retreat three trees at a time.”

After three months drifting between the al-Nusra Front and another radical group, the Ahrar ash-Shem, Omar gave up. A fragment of tank shell had fractured his leg, and he became disillusioned.

In those days you could still turn up at al-Nusra’s office in Idlib, western Syria, ask for your passport back, and even pick up a bit of cash for the fare home. Questioned by Tunisian police at the airport, he said his trip to Turkey had been to follow a Turkish woman – an affair of the heart that had led nowhere.

He was lucky. Other returnees are not let off so lightly. Some have alleged torture and mistreatment at the interrogation centre operated by the Tunisian police’s anti-terrorism brigade in Gorjani in the capital, says defence lawyer Hafedh Ghadoun.

The Argentinian judge Juan Méndez, a UN special rapporteur on torture, on a mission to Tunisia in June expressed concern that the Gorjani facility was the only one he was refused immediate access to.

As with other countries dealing with returnees from the war in Syria and Iraq, Tunisia faces a legal conundrum in how to deal with crimes suspected to have been committed in a chaotic situation in another country.

With a small but significant block of Tunisian opinion still wavering between Islamist radicalism and the competing attractions of a democratic system, there is also a desire to avoid unnecessarily criminalising young people who may have been radicalised in those heady post-revolutionary days.

Ghadoun believes no former Isis combatants have yet returned to Tunisia. In cases that have so far come to court there have been some acquittals, and prison sentences of six months or a year have been common.

However, judges’ attitudes are going to change, Ghadoun grimly predicts, if Isis combatants suspected of serious crimes and atrocities begin to return.