The US-led coalition to defeat ISIL has accomplished a significant victory by driving the militants from their strongholds in Mosul and Raqqa, thereby depriving them of their dream of establishing their so-called caliphate. But now that the military campaign is winding down, a new and equally challenging problem has arisen: namely, what to do with the hundreds of foreign fighters who have been captured and are now being held by the American-backed Syrian Defence Forces.
The dilemma over how to deal with captured ISIL fighters has been brought into the spotlight by James Mattis, the US Defence Secretary, who has sparked a diplomatic rift with Britain over the fate of two members of the so-called "Beatles", a group of British extremists who were responsible for some of the most gruesome acts of violence perpetrated in ISIL's name.
Alexanda Kotey and El Shafee Elsheikh, who are originally from west London, are reported to have been captured while attempting to flee across the Syrian border following the collapse of ISIL’s stronghold in Raqqa. It has been suggested the men may have been trying to return to Britain to commit further acts of violence.
Kotey and Elsheikh are said to be members of the “Beatles”, a group of violent men who were given the nickname because of their strong British accents. They are accused of carrying out torture and summary executions, such as those of British aid worker David Haines and American journalist Steve Foley.
Mohammed Emwazi, the group's notorious leader who was also known as "Jihadi John" and was filmed in numerous videos carrying out beheadings, is believed to have been killed in a coalition airstrike in November 2015. A fourth member is serving a prison sentence in Turkey on terrorism charges.
The controversy over what to do with Kotey and Elsheikh, as well as the hundreds of other foreign fighters being held by the SDF, has surfaced as a result of the British government’s decision to withdraw their British passports, thereby rendering them stateless. Nor is Britain the only country that is trying to wash its hands of extremists. ISIL fighters from as far afield as Russia, Europe, China, Japan and a number of Arab countries are currently being held in detention, and none of their home countries appears to want them back.
The attitude of most governments has been succinctly summed up by British Defence Secretary Gavin Williamson, who said earlier this week, “I don’t think they should ever set foot in this country again. They turned their back on Britain, our values and everything we stand for — they are the worst of the worst.”
But while this adequately sums up the attitude of countries who have seen their citizens abandon their homes and families to wage jihad on behalf of ISIL, it does not answer the thorny problem of how to deal with captured fighters who now find themselves stateless.
In many respects it is a rerun of the dilemma another US-led coalition faced following its initial military intervention in Afghanistan in 2001 to destroy Al Qaeda and its allies in the wake of the September 11 attacks. While the military campaign itself was a great success - Al Qaeda and its Taliban backers were routed within a matter of weeks - the aftermath proved more problematic, particularly Washington’s treatment of the hundreds of foreign fighters who were captured fighting for Al Qaeda and the Taliban.
Because many of these fighters had no known country of origin, and due to the immense difficulties the US and its allies faced acquiring enough evidence on the battlefield to bring a successful prosecution, those deemed to be the most dangerous fighters were transferred to America's Guantanamo Bay detention facility in Cuba, where a number of them remain to this day.
While it might have appeared a practical solution to an intractable problem at the time, in the long-term the whole Guantanamo issue has turned out to be self-defeating for the US and its allies owing to the widespread international criticism it has attracted.
Even so, there has been talk in some Washington circles of sending some of the captured fighters in Syria to Guantanamo, not least because US President Donald Trump spoke of his desire to send foreign fighters to the detention facility when he was campaigning for the White House.
So long as Mr Trump remains president, this possibility cannot be ruled out, it is now clear that senior members of his national security staff, many of whom had to deal with the fall-out from the Guantanamo controversy when they were serving in Afghanistan and Iraq, have no desire to repeat the mistake.
This certainly seems to be the case with Mr Mattis, a former Marine general who commanded coalition forces in both conflicts. Speaking in Rome earlier this week, he called on the host nations of captured fighters to accept responsibility for their citizens and put them on trial.
“Doing nothing is not an option,” he said. “The important thing is that the countries of origin keep responsibility for them.”
Mr Mattis certainly has a point. If the US and its allies want to maintain the moral high ground in the war against Islamist-inspired extremism, then they must bring those suspected of committing heinous crimes to justice, rather than abandoning them in a legal limbo.
Con Coughlin is the Daily Telegraph’s Defence and Foreign Affairs Editor