MELBOURNE, Australia — It was the breakthrough that Karen Nettleton had pursued for five years: The orphaned Australian children and grandchildren of Khaled Sharrouf, a notorious Islamic State fighter, were removed from a Syrian camp this week and will soon return to Australia.

Ever since her daughter, Mr. Sharrouf’s wife, took the eldest of the children to ISIS territory in 2014, Ms. Nettleton had searched for them, eventually making three trips to Syria and pressuring the Australian government to stage a rescue.

Now that the children — there are six, from newborn to age 18 — are in Iraq and a step closer to repatriation, the government is confronting its next big challenge in the case: how to reintegrate them into Australian society.

With the fall of the so-called caliphate established in Syria and Iraq by the Islamic State, also known as ISIS, governments around the world are facing the same moral, political and security questions that have vexed Australia, as thousands of wives and children of the group’s fighters languish in camps in Syria.