An Iraqi officer shuffled through identity cards as he sat at a battered desk by the side of the dust-blown highway heading east from the city of Mosul.
Six men in dirt-spattered tracksuits huddled nearby, waiting on a concrete slab, part of the latest convoy of civilians to flee fighting as government forces try to oust Islamic State jihadists from the city.
Clutching a phone to his ear, the officer stood up and read out the men's names one by one, waiting a second to receive a word from the person on the other end. He then handed them back their identity cards and let them go.
Eventually, only one man remained. The officer repeated his name several times, his voice rising.
Suddenly, he grabbed the man and started hauling him into a makeshift cell at the back of what was once a roadside car workshop.
"Everyone in Mosul knows who the terrorists are," said Lieutenant Ali of Iraq's special forces, part of a group of officers involved in the screening.
Some 70,000 civilians have fled the violence since Iraqi forces started the offensive to retake Mosul last month.
After more that two years of extremist rule over the city of more than a million inhabitants, the authorities are desperate to stop any jihadists escaping among the throngs of displaced civilians.
To do this, they say they use a database of intelligence collected from different sources, including Western spy agencies, old records and Mosul residents who lived under IS.
"We get information from Mosul because of the difficulties people suffered during the two-and-a-half years under Daesh," Ali said, using an Arabic acronym for IS.
Official figures are not made public on how many people have been detained by the various forces fighting IS -- the Iraqi army, special forces, police and Kurdish peshmerga.
Intelligence officer Ali, who did not give his second name, estimated that some five percent of the men fleeing the city have been held on suspicion of cooperating with IS.
That would mean hundreds -- if not thousands -- are currently detained.
- 'I'm in prison' -
Signup to our newsletter and follow us on Facebook and Twitter!
Iraqi officials say the men they detain are investigated and -- if enough evidence is provided of their ties to IS -- put on trial.
Some parts of Mosul's population initially welcomed the jihadists, following abuses committed by the Shiite-dominated security forces against the Sunni-majority city's residents before IS swept in.
And when the daily hardships of life in IS's tyrannical "caliphate" became evident, some level of acceptance of the jihadist organisation was sometimes necessary to survive.
Dhiaa Zuhair clutched his ID card in relief as he walked back to his family after passing through the screening.
The dust from walking out of the Mosul battlefield still clung to his clothes, shoes and hair.
"I wasn't worried because I had nothing to do with IS," he said. "The forces have very good intelligence."
But some said that the dragnet for IS members was falling too wide and subject to abuse. Several rights groups have said the process is opaque and has not undergone enough scrutiny.
At her tent in the sprawling Khazir camp for displaced people, Um Yamen showed off the note she had received from her husband that morning.
"I'm well and in good health," read the message handwritten on paper from the International Committee of the Red Cross. "I'm in prison."
It was the first news she had received from her husband in the 20 days since Kurdish forces arrested him as he followed her out of their village close to Mosul.
They accused him of working with IS, and Kurdish intelligence is holding him in a neighbouring district.
But his wife insisted he was just a clerk at the local power company doing his job.
The real reason he was detained, she said, was that some people in the village had a grudge against him and claimed he was a member of IS to get him in trouble.
"This is an injustice. He didn't do anything wrong. He was just going to his job," she said, asking to use a pseudonym.
"I don't really understand why this has happened."