The man stands furtively on a street corner near the broad avenue cutting through Tunis, his face masked by a hoodie, his tense eyes scanning the workday crowd for any hint of Islamic State militants.

He was one of them before he left Syria, only a year ago, and he is afraid.

Now he chain-smokes as he describes the indiscriminate killing, the abuse of female recruits, the discomfort of a life where walls were optional and meals were little more than bread and cheese or oil.

"It was totally different from what they said jihad would be like," said the man, Ghaith, who asked to be identified by his first name only for fear of being killed.

While foreigners from across the world have joined the Islamic State militant group, some arrive in Iraq or Syria only to find day-to-day life much more austere and violent than they had expected. These disillusioned new recruits soon discover that it is a lot harder to leave than to join. Even if they escape, they are trapped in limbo, considered a threat by both their former comrades-in-arms and their homelands.

Thousands of returnees are now under surveillance or in jail in North Africa and Europe, where they are often held to be terrorists and security risks. They are viewed with even more suspicion after the Jan. 7 massacre at the Charlie Hebdo newspaper in Paris, orchestrated by a pair of French-born brothers who laid low for years before putting their weapons training to use.

"The men who manage to leave Islamic State or al-Nusra have to do so secretly," said France's top anti-terror judge, Marc Trevidic. "Not everyone who returns is a budding criminal. Not everyone is going to kill — far from it. But it's probable that there is a small fringe that is capable of just about anything."

At other times, would-be escapees don't make it out alive. Many emirs, or unit leaders, simply order death for those they suspect of disloyalty, according to Islamic State propaganda, analysts and those who managed to leave.

The Syrian Observatory for Human Rights says the militant group has killed 120 of its own members in the past six months, most of them foreign fighters hoping to return home. The same propaganda productions that call for skilled recruits in engineering, medicine and finance also distribute videos showing the execution of fighters who have strayed.

The Associated Press talked to more than a dozen former fighters as well as their families and lawyers about life in the Islamic State group and escape from it. Many of them spoke only on condition of anonymity for fear of retribution. Their accounts were similar.

___

PROOF OF DEVOTION

Ghaith went to Syria for jihad to reap what he believed would be the rewards of paradise. But once there, Ghaith said, he was highly disturbed to see female recruits forced into sex in the camps, often "married" for the night by different men.

"It was by force, because they couldn't say no or they would be killed," Ghaith said.

Several others described the same phenomenon to AP, all with evident discomfort. Some men described arguments in the camps over whether such treatment was permissible under Islam.

Ghaith's reluctance to participate in killings soon attracted attention. One night, fellow fighters woke him with a knife to the throat and demanded he recite a particular Quranic verse on Islamic warfare to prove his devotion.

Ghaith left the Islamic State by one of the only ways possible — he surrendered to Syrian soldiers while scouting a checkpoint. He was held for four days before being turned over to his parents, who were in Syria along with a delegation of families seeking their children.

___

THOSE WHO DIE

Unlike Ghaith, the only way out for Youssef Akkari was death.

Akkari began going to the mosque more after one of his friends drowned. There he fell in with a local band of religious youths who talked to him about religion, war and the evil of Syrian leader Bashar Assad. His brother, Mehdi Akkari, known by his rapper handle DJ Costa, described how Youssef would spend hours in his room listening to religious chants and reading on his laptop.

One day the family received a message that he was in Turkey and would soon cross over into Syria.

Then Youssef lost his glasses and became useless to the Islamic State as a fighter in Syria, according to his brother Mehdi. So he was put in charge of preaching jihad to arriving Tunisians, who included doctors, computer experts and even cooks.

The camp was comfortable with good food, Youssef reported, but the jihadis were a band of criminals who stole cars and belongings from other people's houses. After seven months, Youssef began to plot his escape, along with two brothers.

The brothers never made it. Their commander found out and had them killed immediately.

Youssef got just enough warning to hide out. He turned himself in to Kurdish fighters who took him to Turkey, and ultimately made his way back to Tunisia, his brother recounted.

But resuming a normal life in Tunisia proved impossible for Youssef, with police harassment on the one hand and his terror of vengeful militants on the other. He returned to Syria and died in an airstrike just outside the northern city of Kobani in October, in a car filled with foreign fighters. The circumstances of his death are unclear.

Islamic State militants consider death appropriate for those who try to escape.

"If one leaves the caliphate, you are no longer a Muslim ... and should be punished," explained Amandla Thomas-Johnson of CAGE UK, which works to reintegrate former extremist fighters in Britain.

___

NO IDENTITY

The Islamic State group works to prevent recruits from leaving from the time they join.

The first step is the removal of passports and identity documents so foreign fighters cannot go home freely. Islamic State propaganda videos, for example, have highlighted French fighters burning their passports and leaving their so-called infidel life behind.

Hamad Abdul-Rahman, an 18-year-old Saudi who made the trip last summer, said he was met at the Syrian border by seasoned militants who escorted him to a training camp in Tabaqa, Syria.

"They took all my documents and asked me if I want to be a fighter or a suicide bomber," Abdul-Rahman told AP from a maximum-security prison in Baghdad, where he was jailed after surrendering to Iraqi forces. Abdul-Rahman was shackled, handcuffed and hooded during the interview and flanked by two armed guards.

He chose to fight.

There were a lot of foreigners in his camp, he said, some speaking German, French, Russian, Arabic and Tajiki languages. The days began with dawn prayers and lessons in Sharia, or Islamic law. After breakfast, they played sports, followed by weapons and combat training. After noon, they would repeat the rotation.

In early September, he surrendered. An Iraqi defense ministry video aired on state television showed Abdel-Rahman minutes after his arrest, dehydrated and dirty, identifying himself to Iraqi soldiers.

Another Tunisian recruit, Ali, said he stayed in a camp with about 500 people for two months in the winter of 2013, eating little, bathing less, and following orders to go ambush soldiers in the nearby mountains. Then he was tapped to become a courier between Syria and Tunisia, taking back news, money and propaganda videos to raise more recruits.

After four courier trips in three weeks, he left the group in disgust. On one trip to Tunisia, he simply stayed.

He described his journey while sitting in a public park in Tunis, dropping his voice low if anyone approached. When a man sat near him, he moved to the other side of the park.

"I feel like I was a terrorist, I was shocked by what I did," Ali said. His advice for would-be jihadis: "Go have a drink. Don't pray. It's not Islam. Don't give your life up for nothing."

___

FIGHT OR FLIGHT

The predicament for governments is to figure out whether a recruit is returning home to escape from the Islamic State or to further spread its ideals and its violence.

France alone has detained 154 returnees and says about 3,000 need surveillance. Britain has arrested 165 returnees, after about 600 went to Syria. And Germany considers about 30 of its 180 returnees extremely dangerous, according to government figures.

Imen Triki, a lawyer who represents returnees in Tunisia, says the majority escape because they are dismayed to find reality so different from the high-gloss, HD video version of jihadi life portrayed in Islamic State propaganda.

"We can say maybe 65 to 70 percent of the people that leave want to return because they find a different situation than what they expected," Triki said.

However, there is often no way to prove it. After the January terror attacks that left 20 dead in Paris, including three gunmen, the French government seems in little mood to give the benefit of the doubt to anyone with ties to al-Qaida or Islamic State militants.

"De-radicalization, de-programming, it's not in French culture. (For many people in France), they need to be punished. That's it," said Justice Minister Christian Taubira. "These are the people who can bear witness, who can dissuade others."

French lawyer Martin Pradel said his client is one of 10 men from Strasbourg who left for Syria last winter after seeing images of victims thought to have been killed by chemical weapons from Assad's government. The men planned to take up arms on behalf of Syrian civilians, whom they felt had been abandoned by the international community, Pradel said.

But they ended up crossing into territory controlled by the group then known as ISIL, which suspected they were spies or enemies. They were jailed for two weeks, and then transferred and locked up again for three weeks. In the process, two of the French recruits died in an ambush.

The men decided to leave, one by one so as not to draw attention.

"They left at night, they ran across fields, they practically crept across the border," Pradel said.

His client surrendered to Turkish authorities. Since he lacked ID, he was taken to the French embassy for temporary transit papers. In France, he was placed under surveillance for three months and then detained. He remains jailed, along with the others who traveled with him.

The French government accuses the Strasbourg men of running a recruiting ring for extremists and is deeply suspicious of anyone who claims to have turned away.

It was a similar escape for four Frenchmen from Toulouse, according to their lawyers.

Pierre Dunac, the lawyer for Imad Jjebali, said the men went to Syria in hopes of helping besieged civilians. But they ended up in territory taken over by Islamic State and were imprisoned somewhere near the Turkish border for refusing to obey orders. They were awaiting a trial of sorts, which they assumed would end badly.

One day, Dunac said, their jailer gave them their papers. He told them, "I'm going to pray," and he left them alone right by the door.

"They understood that he was letting them leave," Dunac said. "Why? It's astonishing. ... They themselves didn't understand why.

"They knew only which was north and south, and they walked to the border."

Like the young man from Strasbourg, the group surrendered to Turkish soldiers, and the men were deported to France. The French government has acknowledged that it botched arresting them upon their return as planned, with agents going to the wrong airport. The men have since turned themselves in and are in jail facing terrorism charges.

In Tunisia, where close surveillance of 400 returnees is far more common than arrests, Ghaith is now a free man by most measures. But he does not act like one. He neck still bears a scar where his fellow fighters held the knife, a reminder of a life he entered enthusiastically but came to hate.

"It's not a revolution or jihad," he said. "It's a slaughter."

___

Hinnant reported from Paris. Associated Press writers Zeina Karam in Beirut; Nicolas Vaux-Montagny in Paris; Vivian Salama in Baghdad; and Danica Kirka in London contributed.