The oldest are probably just toddlers, innocents born into one of the most reviled terrorist movements in the world.

And very soon, they could be the responsibility of the federal government.

The children of Canadian members of the so-called Islamic State of Iraq and the Levant form part of a potentially explosive dilemma confronting federal officials. As ISIL teeters on the brink of military defeat, what should the government do when and if Canadian members of ISIL are captured?

Some experts say Ottawa has no choice but to try to repatriate and prosecute in Canada any detained members, ensuring they aren’t tortured or otherwise mistreated by local forces. As for those ISIL children, if they have one Canadian parent, they would be citizens and, lawyers say, deserve help.

“The government has absolutely no choice but to protect the Charter rights of these Canadians,” said Lorne Dawson, a University of Waterloo professor who has extensively studied radicalized youth.

“The embassy, the consulate would have to deal with them, the way they would any Canadian who’s gotten in trouble abroad, and assist them to come home if that’s what they want to do.”

Others note there would be little public sympathy — especially after the controversial payment made to Omar Khadr — for bringing back foreign fighters, even if they were to face justice in Canada.

The French government, for one, has already said that Iraq’s court system, not France’s, should judge one of its nationals captured recently near Mosul, noted Phil Gurski, a former Canadian Security Intelligence Service analyst.

“Does the Canadian government have a legal, let alone a moral, responsibility to act on these people’s behalf? I think the answer is ‘No,’ ” said the head of the Borealis consulting company. “They made a conscious decision to leave this country and to join a group that everyone and his dog knows is a terrorist group … ‘It sucks to be you; live with it.’ ”

Andrew Gowing, a spokesman for Public Safety Canada, said the government would not speculate on what it would do with any captured Canadians, but said all citizens have a right to consular assistance.

The issue is not just an academic one. Unconfirmed reports suggest 20 female foreign participants in ISIL were caught by Iraqi forces in Mosul last weekend. Local media outlets suggested two were Canadians, though Iraqi sources have told the National Post the group included only Russian, French and German women.

Regardless, federal officials have told Dawson they are discussing the prospect of Canadian ISIL activists surfacing overseas, and seem to have come to some firm conclusions about what to do.

“They always stress … ‘We cannot in any way afford to allow our actions to result in a Canadian citizen receiving basically torture, or abuse. That will never happen again’.”

Turning a blind eye to maltreatment by Iraqis or others could lead to a human-rights claim like Khadr’s, Dawson said. Though accused of killing an American soldier while a teenage member of al-Qaida, Khadr received a $10.5-million settlement recently over Canada’s role in his torture and other rights violations while in U.S. military custody.

Estimates from the government and outside researchers suggest as many as 100 Canadians have travelled to Iraq or Syria to join ISIL, including 15 to 20 women, most of whom have reportedly had children there.

Citizens facing serious charges in a foreign country with a well-functioning justice system would normally be left to that nation’s courts, says Anil Kapoor, a Toronto lawyer who has acted on numerous national-security cases. But given that ISIL members would be detained in a chaotic war zone, Canada should probably try to repatriate them, he said.

Once here, they could face charges under section 83 of the Criminal Code, such as leaving Canada to join a terrorist organization, participating in or facilitating terrorist activity, or committing a crime for a terror group, with penalties of up to life in prison.

If local authorities in Iraq or elsewhere insisted on prosecuting them, Canada should at least provide diplomatic assistance, said Kapoor.

Even if some are convicted of crimes in Canada, efforts ought to be made to reintegrate them into society after their sentences end, argued Barbara Jackman, a Toronto immigration lawyer who has often handled terror-related cases.

“I really think they need to work with the Muslim community in terms of developing plans to assist them,” she said. “They are Canadian kids, we can’t just sort of throw them away.”

Babies born in the Middle East to at least one parent who is a Canadian citizen would automatically be Canadian themselves, Gowing said.

Such children may, though, face an uncertain future, said Gurski.

“This issue of orphans and kids born to people who joined Islamic State is going to haunt us for a decade,” he said. “Who wants to take care of them? It’s not the kids’ fault, but these are the sons and daughters of terrorists.”