BAGHDAD - An Iraqi court said Sunday it had condemned to death by hanging a German woman of Moroccan origin after finding her guilty of belonging to the Islamic State jihadist group.

She is one of hundreds of foreign jihadists held by Iraqi authorities, who in December announced the defeat of IS after a gruelling three-year battle. The German was sentenced for providing "logistical support and helping the terrorist group to carry out crimes," said court spokesman Abdel Settar Bayraqdar.

"The accused admitted during interrogations that she left Germany for Syria then Iraq to join IS with her two daughters, who married members of the terrorist organisation," he said.

The woman, who was not identified, has 30 days to appeal, after which she could be executed, said legal expert Ezzedine al-Mohammadi. She is believed to be the first European woman to be sentenced to death in Iraq in relation to IS.

A judicial source told AFP that one of the woman's two daughters had been killed while with the jihadists. The German media has reported that a German named Lamia K. and her daughter left Mannheim in August 2014 and were arrested by Iraqi forces during the final stages of the battle to oust IS from its stronghold Mosul last July.

At least two other German women are also in prison in Iraq, whose authorities have not officially said how many jihadists were taken prisoner during the battle against IS. A German teenage girl suspected of joining IS was also arrested in Mosul, according to Germany's justice department. Baghdad declared victory over IS in December, after expelling the jihadists from second city Mosul in a gruelling months-long offensive.

IS, which at the height of its power held around a third of Iraq's territory, had swept across the country's north and parts of Syria in 2014, calling on Muslims everywhere to head to its "caliphate".

Iraqi commanders and Iraqi Kurdish fighters say hundreds of IS fighters gave themselves up during the battle, while others are said to have escaped by blending in with civilians fleeing the fighting. In the province surrounding Mosul alone, more than 4,000 jihadists were arrested, police chief General Wathiq al-Hamdani said.

Researcher Kim Cragin of the National Defense University wrote on the Lawfare security blog in late November that 5,395 foreigners were in jail in Syria and Iraq.

The Soufan Centre, a nonprofit security analysis group, reported in October that 190 German women with 70 children had joined the IS "caliphate". According to the German intelligence services, 910 people left Germany to join jihadist groups in Syria or Iraq.

About a third of them returned to the country, 70 of whom are considered combatants, while 145 were killed. In December, Human Rights Watch reported that 7,374 people had been found guilty and 92 executed since 2014 under Iraq's anti-terrorism law.

The New York-based group reported numerous accusations that security forces had used torture to extract confessions. In September 2017, the same Baghdad court sentenced to death by hanging a Russian man who was captured in Mosul and found guilty of fighting for IS.

In December, a Swede of Iraqi origin was among 38 people executed after being convicted of "terrorism". Despite the jihadists' quasi-state being reduced to tatters, IS has continued to carry out attacks including in Baghdad.