A three-year-old Russian girl whose parents fled to Syria to fight for Islamic State (Isis) has been reunited with her grandparents.

Sofia Zaynukova had been left in an Iraqi prison with strangers after her parents died in combat for Isis. The jail was exclusively for wives and widows of Isis soldiers. She was being taken care of by a woman who grabbed her following an airstrike in Mosul.

According to RT, the girl's mother was buried under rubble during a battle. The family left Russia in 2015 after the father told relatives they were seeking medical help in a city nearby. They are from the southern region of Dagestan.

The father appeared to be following his older brother, who also left Russia to fight for Isis along with his two daughters – Sofia's cousins. Five-year-old Khadija and three-year-old Fatima were returned to the grandparents in Russia after their father died.

"I lost my two sons, but I was given me granddaughters back," the grandfather said to RT. The cousins were living in an orphanage in Baghdad. They were returned after a social media video about parents fighting for Isis revealed their location.

Russian senator Ziyad Sabsabi said he and a team searched for Sofia for weeks. "We faced an almost complete lack of information both when it comes to Iraqi officials and Russian embassy officials," Sabsabi. "We knew she was alive, but had no information on her whereabouts."