An Iraqi criminal court has sentenced six French nationals to life in prison for joining the ISIL (ISIS) group, state media reported.

The Karkh Criminal Court issued the sentences on Wednesday, with representatives from the French embassy in attendance, the Iraqi News Agency (INA) reported, citing Iraq’s judiciary.

“With these six sentences, the total number of those convicted in this case has reached 16, all of whom are French nationals,” the judiciary said in a statement cited by INA.

Fifteen of the 16 defendants have been sentenced to life in prison. The court sentenced one defendant to 15 years in prison last month.

Trials began in September for 47 French citizens who were transferred from Syria last year and charged with belonging to the armed group. ISIL controlled large parts of Syria and Iraq between 2014 and 2017.

In February, Iraq received more than 5,700 ISIL detainees from over 60 countries after the United States transferred them from Syria. They had spent years in prisons run by Kurdish-led forces.

Among the foreign fighters sentenced on Wednesday was Thomas Barnouin, a 45-year-old Frenchman. During his trial, he said he travelled to Syria convinced he had a religious duty and did not know ISIL would carry out attacks in France, according to AFP.

For years, Iraqi courts handed down hundreds of execution orders and life sentences to people convicted of “terrorism” offences, including foreign fighters. Some rights groups denounced the trials as rushed and lacking due process.

ISIL swept across Syria and Iraq in 2014, committing massacres and forcing women and girls into sexual slavery. Iraq, backed by US-led forces, proclaimed victory over the group in 2017. Kurdish-led forces supported by Washington defeated ISIL in neighbouring Syria two years later.

Iraq is still reckoning with ISIL’s legacy. Mass graves are being uncovered, and testimonies of the group’s brutality remain to be investigated.