The United States is ready to help countries repatriate Islamic State jihadists detained in Syria but time is of the essence and Washington insists that ultimately it is up to their home governments to come up with solutions.

The window to organize the fighters' return with US support "is quickly closing," a US State Department official told AFP, on condition of anonymity.

"We call on all countries to step up and take responsibility for their citizens that went to Syria to fight for the Islamic State."

US President Donald Trump's sudden announcement in December that US troops would be withdrawing from Syria set off a countdown for governments whose citizens, having joined IS, were captured by the US-backed, Kurdish-led Syrian Democratic Forces (SDF).

Those forces, backed by artillery fire from a US-led coalition, are in a final push this week to retake a last morsel of IS-held territory in Syria.

Once the coalition declares it has taken all IS territories, the White House is expected to withdraw US troops.

When that happens, the risk is high that "foreign terrorist fighters", or so-called FTFs, will escape SDF control, posing a new threat.

Several countries that have chosen to leave the jihadists in SDF detention -- including France -- now confront a diplomatic, legal, political and logistical puzzle.

For governments whose own publics have been shaken by terrorist attacks in recent years, it's thorny problem: how to repatriate suspects held in a war zone by forces that do not belong to a recognized state.

Despite the tough questions -- and under pressure from Washington -- some governments seem to be figuring it out.

- US planes -

For nearly two weeks, the Trump administration has been pushing its allies to bring their citizens home.

"Repatriating foreign terrorist fighters to their countries of origin and prosecuting them is the best way to prevent them from returning to the battlefield," the State Department's counterterrorism coordinator, Nathan Sales, told AFP.

In total, several hundred foreign jihadists -- likely some 800 -- are in SDF hands, in addition to non-combattant women and children, who also are awaiting repatriation. Their home countries include Tunisia, Morocco, Saudi Arabia, Turkey and Russia -- as well as France, Britain, Germany and Belgium.

US diplomats have seen signs the French government is willing to hold behind-the-scenes talks on how to bring their nationals home.

In Paris, a source close to the issue told AFP that a hypothesis under "strong consideration" is repatriation of the more than 100 French citizens, most of them minors, aboard US planes.

The commander of US forces in the Middle East acknowledged in early February that the United States has the responsibility to facilitate this delicate task.

"We can make arrangements," said General Joseph Votel.

The US has already organized some flights to take jihadists held in Syria home to face justice in their countries.

It has been willing to consider logistical solutions tailored to the legal and political constraints that governments are facing, even making stopovers in third countries if necessary.

But as some countries consider shuttles or operations coordinated under the US umbrella, the Trump administration might be less than conciliatory if talks bog down.

"It is not the responsibility of the SDF, or the United States, to find solutions for the hundreds of FTFs in SDF custody," warned Sales.

"Countries must take responsibility for their own citizens and not look to others to solve the problem for them," he added.

The State Department official who spoke to AFP on condition of anonymity, cautioned that "repatriation operations are not as simple as sending an aircraft to a terminal in northeast Syria, loading it up with FTFs, and flying them to their country of origin."

For every repatriation operation, he said, there are technical and logistical issues that must be addressed: the nationality of each jihadist must be verified, they must be gathered in a single location, overflight clearance must be received, and resources must be secured from all parties involved to execute the operation.

And there is an overriding US condition: "Under no circumstances during these operations does the United States ever take custody of the FTFs," the official said.