Iraq on Tuesday sentenced a French woman to life in prison for belonging to the Islamic State group, raising to more than 180 the number of such convictions of foreign women since the country's defeat of IS.

Djamila Boutoutaou, a 29-year-old of Algerian origin, told a Baghdad court that she left France with her husband, a rapper.

She said she thought they were going on holiday but ‘when I arrived in Turkey I discovered that my husband was a militant’.

She said she was forced by her husband to join IS and live in the ‘caliphate’ that the militants proclaimed in 2014 straddling Syria and Iraq.

Boutoutaou, who appeared in court wearing a brown headscarf, said she and her two children had been forced to live in a ‘cave’.

Her husband was killed near the former militant stronghold of Mosul, northern Iraq, and her son died in bombardment, Boutoutaou said, before she and the wife of a neighbour fled and surrendered to Kurdish peshmerga fighters.

Two women from Russia, both holding children in their arms, were also sentenced to life in prison at the same hearing, while five from Azerbaijan were condemned to death along with a woman from Trinidad.

Iraq declared victory in December against IS, which at one point controlled a third of the country.

The Iraqi anti-terrorism law empowers courts to convict people who are believed to have helped IS even if they are not accused of violence.

In January, an Iraqi court condemned a German woman to death after finding her guilty of belonging to IS.

A court the following month sentenced another French woman to seven months in jail for entering Iraq illegally but ordered her release on time already served.

Under Iraqi anti-terrorism laws, a total of 97 foreign women have now been condemned to death since January and 185 others to life imprisonment by courts in Baghdad, a judicial source told AFP.

Most of the women were from Turkey and republics of the former Soviet Union.

Iraqi authorities have not announced any of the sentences being carried out.

Related Story