ERBIL, Iraq—The distant roar of jet engines sent 8-year-old Ibrahim scrambling for cover, his survival instincts borne of years living under bombardment on the battlefields of Syria.

But the boy was no longer in a war zone. He was in a hotel in this northern Iraqi city, and the plane overhead was a commercial airliner, like the one that would soon take him home to Sweden, along with six younger siblings.

Ibrahim’s parents, both from Scandinavia, joined Islamic State at the height of its power and were killed as U.S.-backed forces battered the group’s last redoubts in Syria this year.

Swedish authorities, under pressure from humanitarian organizations and the children’s tenacious grandfather, Patricio Galvez, earlier this month evacuated the orphans from a camp in Syria.

The Wall Street Journal chronicled Mr. Galvez’s quest to find his grandchildren and bring them to safety in a front-page story earlier this year.