Image copyright iStock

When the so-called Islamic State group seized control of a town near Mosul and began killing police officers, some of them resorted to unconventional measures to stay alive, reports John Beck.

A niqab saved Abu Alawi.

For more than two-and-a-half years it helped keep the middle-aged former police officer hidden from IS and safe from the bullets and knives that killed almost all his colleagues.

When the jihadists arrived in his hometown of Hammam al-Alil in mid-2014, as they swept across northern Iraq, the first things they did was to round up police and army officers.

They killed the higher-ranking men immediately, but eventually offered an amnesty of sorts to the rest. If they renounced the government in Baghdad and pledged to live under IS rules, then they'd go free.

Abu Alawi stayed in hiding. At first in his home or a bolthole dug in his garden. But IS searches became more stringent and he realised that he'd have to move further afield.

Image copyright John Beck Image caption Ahmed, 22, from a pro-government militia, stands in a burnt-out building used by IS as a prison

The solution, he decided, was a niqab - the black, face-concealing veil that IS forces all women under its rule to wear. From then on, when a sympathetic friend would tip him off about impending searches, he'd shroud his moustachioed face and portly figure and move somewhere safer, disguised as a woman.

There was a thrill, he said, in "playing" with IS, but when he passed close by the black-clad militants it wasn't fun any more. Then he feared he'd share the fate of friends who'd donned the same disguise but been less lucky, or less convincing, and were arrested as a result.

"They were near to me so many times and I was so afraid," he said, miming a heart pounding in his chest. "All the time I was thinking I was going to be checked and discovered."

Image copyright AFP Image caption IS eventually left Hammam al-Alil, setting oil wells alight as it went

Hammam al-Alil is a former spa town, once famous for the therapeutic powers of its thermal springs. It's hard to imagine holidaymakers visiting now. I met Abu Alawi there as he waited for a Danish non-governmental organisation to distribute blankets and solar heaters on a cold and damp winter morning. Men and women split into separate queues and stood patiently between the muddy puddles.

Image copyright John Beck

Find out more

From Our Own Correspondent has insight and analysis from BBC journalists, correspondents and writers from around the world

has insight and analysis from BBC journalists, correspondents and writers from around the world Listen on iPlayer, get the podcast or listen on the BBC World Service or on Radio 4 on Thursdays at 11:00 GMT and Saturdays at 11:30 GMT

After IS arrived, I was told, they gathered the former officers in the town's main square. Then they blindfolded them, loaded them on to trucks that drove a short way out of town, and shot or beheaded them.

Federal police took me to one mass grave, a police shooting range turned rubbish dump. The awful smell was the first sign of what had happened there.

Then came the clouds of flies and, lying amid the refuse, between discarded children's toys and food packaging, the badly decomposed remains of a man - his hands and legs bound and marked by signs of torture.

"Under here it's all bodies," our escort said, gesturing towards a series of narrow trenches covered with bulldozed earth and he cautioned that the area was probably still booby-trapped with improvised explosive devices. He estimated there were at least 350 people buried in the area.

Image copyright John Beck Image caption A police officer at mass grave site outside Hammam al-Alil

Another man in the aid distribution queue, Abu Ali - younger, taller and thinner than Abu Alawi - produced his old police ID card.

He'd buried it in his garden while IS was here, and he too had survived the massacre, in part thanks to a niqab.

"All I did was hide, hide and wear the veil like this," he said, stooping over to minimise his stature.

His brother, a fellow officer, was executed, leaving behind a wife and seven children. And when they left Hammam al-Ali, IS took Abu Ali's father with them to Mosul as a human shield.

This was not a unique story. Everyone I spoke to in the town had lost someone, some entire families. One militia member in his early 20s said IS had killed his parents and murdered or captured seven of his brothers.

But a semblance of normal life has in some ways returned to the town.

At the dilapidated thermal baths near the banks of the Tigris, smiling children and soldiers played in the warm waters.

Image copyright John Beck

Others collected grey mineral-rich mud in bottles and touted its therapeutic qualities.

It may be the start of healing, but the scars of occupation by IS will last for some time yet.

Join the conversation - find us on Facebook, Instagram, Snapchat and Twitter.