A German teenager who ran away from home after converting to Islam has been found as Iraqi forces liberated the northern city of Mosul from Islamic State extremists.
She is reported to be in good health and will be questioned next week by Iraqi officials.
The 16-year-old, only identified as Linda W in line with German privacy laws, is receiving consular assistance from the German Embassy in Iraq, prosecutor Lorenz Haase said.
Three Iraqi intelligence and investigative sources confirmed that the girl, who was apprehended in the basement of a home in Mosul's Old City earlier this month, was Linda W.
Iraqi officials added that on the day of her arrest she was "too stunned" to speak, but her condition has improved.
Linda W could theoretically face the death sentence, according to Iraqi's counter-terrorism laws. However, even if she is sentenced to death in Iraq, she would not be executed before the age of 22.
Photos of a dishevelled young woman in the presence of Iraqi soldiers went viral last week, but there were contradicting reports about the girl's identity.
The German teenager had married a Muslim Arab she met online after arriving in the group's territory, the Iraqi officials added.
They said Linda W was one of 26 foreigners arrested in Mosul since the retreat of the extremists there.
So far, the young German has not made any statement. Officials said she is currently being held along with other foreign women at a prison near Baghdad's airport.
Starting next week, she will be investigated by the Iraqis, who will bring in German interpreters for the interrogation since she does not speak much Arabic.
Mr Haase said the girl ran away from her family home in Pulsnitz in eastern Germany last summer. It is not clear yet whether she will return to Germany, he said.
"We, as the public prosecutor's office Dresden, have not applied for an arrest warrant and will therefore not be able to request extradition.
"There is the possibility that Linda might be put on trial in Iraq. She might be expelled for being a foreigner or, because she is a minor reported missing in Germany, she could be handed over to Germany."
The 26 foreigners found in Mosul included two men, eight children and 16 women, Iraqi officials said. Some of those arrested were from Chechnya, and the women were from Russia, Iran, Syria, France, Belgium and Germany.
In addition to Linda W, the Iraqis found three other women from Germany, with roots in Morocco, Algeria and Chechnya. The Iraqi officials said the German-Moroccan woman has a child and both were arrested in Mosul about 10 days ago.
They said the women allegedly worked with IS in the police department. Their husbands were IS fighters but their fates were not clear.
French and German Embassy personnel have already visited the arrested women, they said. The children will be handed over to the countries they belong to, while the women will be tried on terrorism charges in Iraq, according to the officials.
More than 930 people, among them several girls and young women, have left Germany to join IS in Syria and Iraq in recent years, the German news agency dpa reported.
While some have been killed in battle and suicide bombings and others have returned to Germany, there is also a large number that are unaccounted for, German security officials say. Many of them were radicalised via social media.
Local newspapers reported last year that Linda W was in touch with IS members online before she ran away from home. She started wearing long gowns before she disappeared from her family's home last summer, and her mother later found a copy of the girl's plane ticket to Turkey under a bed.
The mayor of Pulsnitz, Barbara Kueke, said she was relieved the girl had been found.