Their territory is lost, their self-styled caliphate has fallen. So what happens now to the jihadists who lived and fought for the militant Islamic state?
Kurdish forces want an international tribunal to try those now being held in camps, many of them men and women with children who travelled from Europe to the front lines.
Their home countries now face a challenge too – what to do with citizens who disavowed democratic values to join the violent extremists.
Like the Netherlands – from where Yousra Elbagir reports.