BERLIN — A German teenager who ran away from home after converting to Islam was found as Iraqi forces liberated the northern city of Mosul from Islamic State extremists, German and Iraqi officials said Saturday.

The girl is reported to be in good health and will be interrogated this week by Iraqi officials.

The 16-year-old girl, identified only as Linda W. in line with German privacy laws, is getting consular assistance from the German Embassy in Iraq, prosecutor Lorenz Haase said from the eastern German city of Dresden.

Three Iraqi intelligence and investigative sources confirmed that the teenager, who was apprehended in the basement of a home in Mosul’s Old City this month, was Linda W.

The girl was “too stunned” to speak on the day of her arrest, Iraqi officials said, but now she is doing better.

They said she had been working with the Islamic State police department.

Linda W. could theoretically face the death sentence, according to Iraq’s counter-terrorism law.

However, even if she is sentenced to death in Iraq, she would not be executed before the age of 22.

Photos of a disheveled young woman in the presence of Iraqi soldiers went viral online last week, but there were contradicting reports about the girl’s identity.

The teenager had married a Muslim Arab she met online after arriving in the group’s territory, Iraqi officials said.

They said Linda W. was one of 26 foreigners arrested in Mosul since the retreat of the extremists there.

So far, the girl has not made any statement. The officials said she is currently being held with other foreign women at a prison near Baghdad’s airport.

Starting this week, she’ll be investigated by the Iraqi officials, who will bring in German interpreters for the interrogation because she does not speak much Arabic.