Just three months ago, the large stone house in the centre of Qayyarah had served as a headquarters of the Islamic State of Iraq and the Levant.

It is a stroke of poetic justice that now - back in the hands of the Iraqi government - it has been turned into a court to try suspected members.

The Qayyarah terrorist investigations court bears a heavy responsibility as the only one deciding the fate of those accused of links to the jihadist group.

Since the offensive to liberate Mosul began in mid-October, a reported 1,000 militants have been killed. But for every 1,000 dead there are thousands more under suspicion.

The Iraqi authorities are in unchartered territory trying to deal with them all.

They are screening all men of fighting age as they flee Isil-controlled areas in the offensive to liberate Mosul.

They check their names against a database of wanted suspects, collated from information passed to them from residents inside Mosul as well as their own records.

There are nearly 40,000 names on the list, 80 per cent of them in connection with terrorism.

It can be an arduous process, particularly when the suspect has a common name. And many get wrongly caught in the dragnet.