When Mariam arrived in Mosul from Moscow in 2014, together with her husband and their kids, she could not imagine that one day she would spend months in prison and would have to answer the court on charges of being a “terrorist”.

“I was thinking, as a Muslim, of spending a better life in an Islamic country like Iraq,” Mariam said from the court’s cell, holding her small child, Oussama.

Mariam is accused of being an ISIL member and risks spending the rest of her life in prison if convicted. She is not alone.

Up to 1,000 women accused of being ISIL members were detained in Iraq after the “terrorist group” was routed from the country. They are now being held accompanied by up to 820 infants, with some others yet to be born.

Most of the women had been widowed by the war against ISIL. They all wait for their hearings in a country where the justice system is described by rights groups as “fragile”.