BAGHDAD: An Iraqi court ordered the release and deportation of a suspected French militant sentenced on Monday to seven months in prison for entering the country illegally, saying she had already served her time.

Melina Bougedir, 27, was arrested last summer in former Daesh stronghold Mosul with her four children, three of whom have been repatriated to France.

Wearing a black dress and purple headscarf, she entered the courtroom holding her other child, a boy with blond hair.

Speaking in Arabic, she said that she had been a housewife in Mosul.

I entered Syria with my French passport but Daesh took it from me. I stayed in Syria for four days and then came to Mosul with my husband and four children.”

She said that her French husband Maximilien, whom she said had been a cook for Daesh, was killed as Iraqi forces battled to oust the militant group from Mosul, which was recaptured last July. Asked her if she regretted what she did, she replied: “Yes.”

Iraq in December declared victory against Daesh after a years-long battle to retake large swathes of territory the extremists had seized in 2014.

An Iraqi court last month condemned a German woman to death by hanging after finding her guilty of belonging to Daesh, the first such sentence in a case involving a European woman.

Soon afterwards, lawyers for Bougedir and another French woman awaiting trial in Iraq for allegedly joining Daesh wrote to French President Emmanuel Macron warning that they could face the death penalty.

Several dozen French citizens suspected of links to the militant group are believed to be in detention camps or prisons in Syria and Iraq.

French Foreign Minister Jean-Yves Le Drian said in Baghdad last week that suspected militants should be tried in the countries where they committed their “crimes,” while reiterating France’s opposition to the death penalty.

Britain has also taken a firm stance against repatriation, as has Belgium which denied a request by one of its nationals to be sent home from Iraq in exchange for cooperating with the authorities.

Several hundred foreigners, both men and women, are thought to have been detained in Iraq for alleged links to Daesh.

In December, a Swedish man of Iraqi origin was among 38 people executed after being convicted of “terrorism.”

And on Sunday, an Iraqi court sentenced a Turkish woman to death and 11 other foreign widows to life in jail for belonging to Daesh, despite their pleas that they had been duped or forced by their husbands to join them in Iraq.