KHAZER CAMP, Iraq — Ali Mohammed thought he knew ISIS — the lethal but mostly disciplined thugs who patrolled his neighborhood in eastern Mosul for the past two and half years.

But it wasn’t until a few months ago, shortly before Iraq’s military began its offensive to retake Iraq’s second-largest city, that the militants’ true character was laid bare.

“They just started to create executions. Just for anybody,” said the 47-year-old iron worker, who now lives with his large family in a tent in the massive camp for displaced people in Khazer. “They were afraid of the people — that’s why they were acting that way.”

Amidst the tales of escalating war and harrowing escapes, Ali Mohammed and his fellow exiles from Mosul described a terrorist group that had rapidly morphed from a formidable pseudo-army that controlled the city into a shambolic gang of murderous thugs.

Related: Two-Front Battle Puts 'Huge Amount of Pressure on ISIS'

If ISIS’ oppressive rule had been unbearable when the group was at its most powerful, it became even worse under its decline as U.S.-backed Iraqi military forces drew closer, according to former Mosul residents. The jittery militants turned harshly on the civilians they had once tried to recruit.

To be sure, life in Mosul had been as difficult as ISIS had been severe. The militants forced male residents to wear their beards long and their trousers short — an indication of piety among very conservative Muslims. Women were made to cover their faces entirely, said Mahren Jassimi Abdullah, 60, who arrived at the Khazer Camp for displaced people from eastern Mosul on Friday.

Khalid Ibrahim, 37, shows off his tattoo inside the safety of the Khazer Camp. Bredun Edwards / NBC News

Khalid Ibrahim, 37, a laborer in eastern Mosul, said he was whipped 100 times by ISIS militants and jailed for 12 days because of his somewhat lewd tattoo of a busty woman on his right bicep.

“They said I was trying to imitate Jewish life,” said Ibrahim. “They prevented people from putting pictures in their homes.”

But early in their rule of the city, ISIS had shown a kind of mercy. Shortly after taking over in June 2014, they told residents who had been in any way affiliated with the security forces or the local police to line up at ISIS administrative offices and “repent” by swearing loyalty to the group. Thousands of men followed suit.

Two years later as Iraqi security forces began to coalesce around Mosul, ISIS militants changed their mind in the most severe way: They rounded up former officers and soldiers and executed them by the hundreds — a crime that human rights groups and the Iraqi military confirmed with the discovery of mass graves.

A member of the Iraqi military forces checks a mass grave they discovered after recapturing the Hammam Alil area from ISIS jihadis during the ongoing operation to retake Mosul on Nov. 7. AHMAD AL-RUBAYE / AFP - Getty Images

“We expected that they would cancel them,” said Qusay Mohammed, 30, a local police officer who escaped slaughter by hiding in abandoned homes until he could make a break for it. “They’re the kind that would stab you in the back.”

Qusay Mohammed and other former residents said that ISIS was suspicious that the soldiers and police would join the invading Iraqi military once they closed in on the city.

But the jihadis’ mounting paranoia didn’t end with ex-officers. As the Iraqi military drew closer, the group became increasingly suspicious of ordinary residents.

“They were afraid to let people get close to them,” Qusay Mohammed said. “They would keep people at a distance scared that [the civilians] would kill them.”

It was around then that city residents noticed an even more profound change: Suddenly, the wizened older ISIS members, many of them foreigners, disappeared from the city streets. In their wake, they left teenage locals whom they recruited into their ranks.

“The elders escaped. They took their families and their money and left,” said Jebril Shehada Abdullah, 28, a former police officer, who speculated that the older fighters had left for Syria or Turkey. “They left only the young guys. They were all locals who were deceived.”

That was hardly a positive development: The younger militants were little more than poorly educated, radicalized thugs intoxicated with power. They roared around east Mosul neighborhoods on motorcycles, threatening and terrorizing civilians.

“The people just stayed inside their houses. If you opened your door they would shoot you,” Abdullah said.

ISIS commandos who had been impossibly pious began to curse like sailors, screaming at residents and insulting their mothers in a way that only a month before would have earned them harsh discipline from their fellow jihadis.

The youthful fighters went door-to-door, demanding that families move closer into Mosul to act as human shields against coalition airstrikes.

Mosul took on the trappings of a horror film. People suspected of treason or spying were not only beheaded as they had been before. The militants took to mounting the severed heads in public or kicking them around like soccer balls, according to reports from several survivors in Khazer Camp.

An Iraqi soldier displays a sword he found, which he says is similar to the kind used by ISIS militants for beheadings, in Intisar district of eastern Mosul, Iraq, on Nov. 4. ZOHRA BENSEMRA / Reuters

ISIS’ paranoia reached its nadir when the jihadis dressed up in pilfered Iraqi military uniforms and paraded into Hammam Alil, a town south of Mosul with Iraqi military flags and arrested everyone who came out to greet them.

“People came out to welcome them,” said Abdullah. “They took 150 locals in Hammam Alil and executed them.”

The anecdote is impossible to independently verify without access to further evidence, but several men from south of Mosul in Khazer Camp corroborated the story.

Even as their circumstances grew increasingly severe, many civilians still hoped to remain. The Iraqi military had airdropped pamphlets appealing to residents to remain in their homes, and many were afraid that life in the displaced peoples’ camps would be worse.

A displaced family at the Khazer Camp on Sunday. Bredun Edwards / NBC News

Ali Mohammed was worried for his wife: She was nine months pregnant and in no condition to flee the city on foot.

After 10 days holed up in his family home, his family of seven found themselves wedged between coalition airstrikes and ISIS mortars and car bombs. They decided to make a run for it.

With his wife and five children in tow, Ali Mohammed fashioned a white flag out of sheets and hustled about three miles to the Iraqi military’s front line. Even as they ran, ISIS sniper fire pecked the ground around them.

Ali Mohammed arrived at Khazer Camp on Nov. 9. His wife gave birth to their sixth child only a day later, he said, born safe from the horror they had just left behind.