Iraq declared victory last month over Islamic State, which had seized control of almost a third of the country in 2014.
About 30,000 troops from the Iraqi Armed Forces, Kurdish Peshmerga fighters and Shia militias participated in the Mosul liberation operation, begun in October 2016.
Many of them, including women, were arrested as Iraqi forces expelled the militants from the country.
She can appeal the sentence, said Abdul-Sattar al-Birqdar, spokesman for Iraq's Supreme Judicial Council in Baghdad.
She is still in captivity in Iraq, possibly awaiting the same fate for her role in enforcing strict Sharia law against women in the territory seized by IS.
The defendant joined IS after she travelled from Germany to Syria and further to Iraq, along with her two daughters, who eventually married militants, Bayrkda said.
Helmet-to-helmet hit knocks Rob Gronkowski out of AFC championship game
Of the 60 minutes and over 50 plays in an National Football League game the outcome often comes down to a single snap. Church was called for unnecessary roughness on the play, and Gronkowski seemed woozy on his feet.
Others are said to have escaped by blending in with civilians fleeing the fighting.
Thousands of foreigners have been fighting for the group Islamic State in Iraq and Syria (ISIS).
According to the German intelligence services, 910 people left Germany to join militant groups in Syria or Iraq.
A Russian ISIS fighter was sentenced to death in Iraq previous year for joining the hardline group.
In December, a Swede of Iraqi origin was among 38 people executed after being convicted of "terrorism".
Baghdad declared victory against IS in December but the group has continued to carry out attacks including in the capital.