Among the tens of thousands fleeing war and despair in the Middle East, one group feels a special relief in reaching Europe: those who have escaped areas ruled by Islamic State extremists and the harsh scrutiny of their religious police.

These refugees tell of how a Western-style haircut, a pair of jeans or a simple interaction with the opposite sex can lead to punishment by the Hisba, the branch of enforcers carrying out a brutal interpretation of Islamic Shariah law.

For many who lived in the ruined landscape of the Islamic State's self-declared "caliphate" across parts of Syria and Iraq, constant fear is what finally drove them to Western Europe.

Ahmed, who owned a women's shoe store in the Syrian city of Raqqa, told of being berated every few days by members of the Hisba because he was waiting on female customers. His wife or sister should do that, they insisted, while also forbidding him from hiring women not related to him.

And if one of his customers so much as lifted the veil from her face to look at a pair of shoes, members from the Hisba — or its women's branch, al-Khansaa — would beat her with a bamboo pole, Ahmed said in an interview with The Associated Press. Like other refugees who used to live in IS-held territory, he spoke on condition he be identified only by his first name for fear of reprisals against relatives still there.

His own nerves were shot from worrying about being arrested or flogged, he said, just minutes after landing on the Greek island of Lesbos in a dinghy with 30 other people. They had sailed from Turkey on the first leg of their journey west.

Ahmed left his wife and three children behind in Raqqa, the de facto capital of the caliphate, and said he plans to send for them once he finds refuge in Europe.

"They are worse than an occupation army and act like they will never leave," he said. "I couldn't take it anymore. Something had to be done, and I am doing it now."

More than 175,000 Syrians and nearly 10,000 Iraqis have made the dangerous sea journey to Greece this year, part of a massive influx fueled in part by Syria's civil war, now in its fifth year.

Many of them have lived in Turkey, sometimes for years, before making the journey to Western Europe.

In that time, they grew used to a more liberal society — a far cry from Islamic State rule, where women must cover themselves from head-to-toe in public and cannot leave their homes without being accompanied by a male relative; where smoking is banned and men must rush to mosques at the call to prayer.

The punishment for violating these rules can range from a warning, time in jail, public flogging, or — for the worse offenses — death.

Abdullah, a 36-year-old carpenter from the Syrian city of Deir al-Zour, said he found the version of Islam imposed by extremists too severe — even for someone who prayed five times a day.

"They are so strict with the rules and punishment they leave no room for Islam's prescribed leniency or repentance," Abdullah said in an interview in the Serbian town of Bujanovac, where he arrived earlier this month with his wife and two children.

Not long after Syrian rebels took over half of Deir al-Zour in 2013, Abdullah and his family fled the fighting to another part of Syria. But he went back often to check on his house, staying for weeks at a time, even as IS fighters drove out the rebels last year and took sole control of that half of the city, while the rest remained in government hands.

"What really forced me to make this trip is the economic and health situation in Deir al-Zour," Abdullah said. Most doctors have fled, he added, and while basic goods were available in the IS-held neighborhoods, most people had no money to spend.

After they landed on Lesbos, some of the Syrians and Iraqis were quick to take advantage of their new freedoms.

Couples celebrated by hugging and kissing in public displays of affection rarely seen back home. Some men coped with the heat and humidity by walking the streets shirtless, and they mingled freely with women wearing shorts and tank tops. Many spoke confidently about their rights, even as migrants — though they also expressed worries about potential discrimination from Europeans. There even were street demonstrations on the island against delays in registering the new arrivals before they can get to the mainland.

Ahmed, the shoe store owner who hopes to join relatives in Belgium, arrived in Lesbos with a nephew in the first week of September, about a week after he left Raqqa. He spoke to AP as he took a 5-kilometer (3-mile) walk from the beach where he landed to the island's capital of Mytilene, the registration site.

He said that as IS militants became the new rulers in Raqqa, many of the city's young men joined the group in search for protection and prestige. "Some of them spy on the residents for IS," Ahmed said.

Over time, foreign fighters and other IS members moved into houses among the population, putting more pressure on residents to observe the draconian rules, he said.

"We keep the television's volume very low, and when my wife steps out on the balcony to hang the laundry to dry, she has to be completely covered," said Ahmed, alluding to an IS ban on watching channels other than the ones broadcasting recitations of the Quran.

For young men, the newfound freedoms outside IS-held parts of Syria and Iraq means having whatever hairstyle or clothes they wanted without being detained or forced to go to a barber for a crew cut. It also includes visits to Internet cafes with no risk of Hisba operatives demanding to check the contents of their social media accounts or their mobile phones.

Abdul-Rahman, a 16-year-old high school student, was detained by the Hisba in the IS-held Syrian town of Manbaj for having a trendy faux hawk haircut. He got away with a warning.

"They asked me questions about basic tenets of Islam. I answered them all correctly and they let me go," he said with a smile, speaking while waiting for a ferry at Mytilene to take him to the Greek mainland earlier this month.

Another young Syrian, Hassan, said he also was briefly detained by the Hisba in his village of Deir Hafer because he was wearing slim-cut jeans.

"They want our pants to be loose and to end above the ankle," the 20-year-old said, referring to the IS-imposed style that militants consider modeled on what was worn by the Prophet Muhammad.

Also on the ferry was Omar, a 36-year-old who owned a small eatery in the city of Mosul in northern Iraq that was captured by IS in June 2014.

"Daesh was OK for the first two weeks," according to Omar, who used an Arabic acronym for the group, but its brutality soon became clear.

The Hisba became active, drove out Mosul's Christians and began demolishing shrines revered by Sunni Muslims but seen by IS as encouraging idolatry.

When the extremists blew up the shrine of the prophet Younis, known in the Bible as Jonah, Omar said he had had enough.

He and his family, who are Sunnis, left for Baghdad after five months under IS rule. In the capital, the Shiite-led government denied them security clearance to live there.

Now they are headed to Finland.

"Cannot live with Daesh and cannot live in my own nation's capital," he said. "Maybe Europe will be kinder."