Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

LONDON — Thousands of children have been born or raised in the Islamic State. Now the world’s governments have to decide how and whether to reintegrate them into their societies.

As the militants retain only a tiny sliver of territory in Syria, Western countries are being forced to grapple with how to deal with minors who qualify for citizenship through their parents, including foreign fighters who carried out atrocities abroad.

A plea last week by a British ISIS bride to return to the U.K. with her infant son illustrates the conundrum.

The family of 19-year-old Shamima Begum — one of three British high school students who together abandoned their lives in east London in 2015 to marry ISIS fighters — has appealed for the U.K. government to help bring the pair home from a refugee camp. They cited the innocence of Begum's newborn child.

British teenagers Kadiza Sultana, Amira Abase and Shamima Begum pass through security barriers at Gatwick Airport near London as they started their journey to Syria in 2015. Begum was aged 15 at the time. Metropolitan Police Service / AFP - Getty Images file

Her baby is “blameless” and has “every right” to grow up in the “peace and security of this home,” the family said in a statement to ITV News just days before Begum's son was born.

While it is not clear how deep Begum's involvement with ISIS went, she has been quoted as saying she had no regrets about moving to Syria. Such comments have triggered a debate in Britain about whether Begum can and should be rehabilitated back into society.

On Tuesday, the U.K. government informed Begum's family it intended to strip the teenager of her citizenship, according to her family's lawyer.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

This morning I told Shamima Begum that she had been stripped of her British citizenship - and showed her the letter that had been sent to her family. “It’s kind of heartbreaking to read” she told me. “It’s kind of hard to swallow” pic.twitter.com/fO6xIoSBS9 — Rohit Kachroo (@RohitKachrooITV) February 20, 2019

Under international law countries are obliged to allow their nationals to return home. But European countries have been reluctant to take back home-grown fighters and their families believe they are safer outside of Europe. Britain has even gone so far as to revoke the citizenship of more than 100 ISIS fighters who had dual nationality.

British interior minister Sajid Javid wrote in an opinion piece in The Sunday Times newspaper that while he felt “compassion for any child born or brought into a conflict zone" when considering the repatriation of their parents who joined the Islamic State he has to think about “the safety and security” of children living in the U.K.

But Fawaz Gerges, a professor of Middle Eastern politics at the London School of Economics, said any country which chose to punish children for the crimes of their parents would be haunted by that decision.

“Its shortsightedness,” he said. “You cannot leave them in the desert, in the wilderness because they’re going to grow to be wild or feel the need or urge to exact revenge."

Children are transported to a refugee camp after leaving Bagouz, Syria, on Feb. 11. Bagouz is ISIS' last stronghold. Chris McGrath / Getty Images

Only Russia has so far repatriated any children of Islamic State fighters — with 27 arriving in Moscow earlier this month, Gerges said. The children were aged between 4 and 13. About 50 other Russian children were expected to return soon, according to the Associated Press.

Gerges said governments also have a legal and ethical responsibility to help these children reintegrate. “It’s not their fault that their fathers are killers and their mothers were participants” in the Islamic State, he said.

Over the weekend, President Donald Trump called on European countries to take back the captured ISIS fighters or risk them being released. “The United States is asking Britain, France, Germany and other European allies to take back over 800 ISIS fighters that we captured in Syria and put them on trial,” Trump tweeted Saturday.

France has said it will repatriate ISIS fighters on a “case-by-case” basis and Germany has said while citizens have the right to return home it is difficult for the government to assess how many German citizens are actually affected.

NBC News security analyst Duncan Gardham said ISIS recruits who wish to return home to the U.K. would have to travel to a British Consulate in Iraq or Turkey and the same would apply for their children.

Couples living in the caliphate were encouraged to marry young and to have as many children as possible so the next generation could “continue to carry the jihad banner,” Gerges said, adding that many ISIS fighters also married more than one woman.

Gardham said from a children would be forced to watch and participate in the execution of ISIS prisoners.

“The motto of ISIS is you’re never too young to start thinking about jihad,” he said. “Indoctrinating children into violence is very much part of their ethos.”

An ISIS math textbook obtained by NBC News in 2017 showed images of guns, bullets and tanks to help explain basic math, while an English language workbook used illustrations of bombs to teach how to read the time.

Mohammed Elshimi, a researcher at the London-based Royal United Services Institute defense think tank, said the working assumption should be that the children of ISIS-linked parents are both vulnerable and dangerous.

Elshimi said risk assessments would be needed on a case-by-case basis, with those closer to the age of 18 more capable of posing a real threat.

“Some of these children have received bomb training,” he added.