For much of America’s war against the so-called ISIS caliphate, it was clear that the extremist proto-state that ISIS created across Syria and Iraq didn’t stand much chance of lasting. The militants had no way to counter the relentless U.S. air-strike campaign and faced a committed enemy in the U.S.-backed local soldiers who did the bulk of the ground fighting. ISIS, a successor to the al-Qaeda militants who battled U.S. troops during the Iraq War, would one day return to its insurgent roots and go underground. It would ultimately be left to America’s local partners to keep up the pressure and ensure the group’s lasting defeat.

These local soldiers—the Kurds in Syria, the Iraqi military, and various other forces—have already suffered many thousands of casualties. Once the territorial caliphate was defeated, America could have focused on rebuilding them as well as the heavily bombed areas where they are now charged with keeping the peace. As The New York Times reported this summer, ISIS still has as many as 18,000 fighters across Iraq and Syria, many of them organized into sleeper cells and hit teams who carry out ambushes, kidnappings, and assassinations across both countries.

Read: The Kurds: Betrayed again by Washington

Continued U.S. support was especially important for the SDF, which number some 60,000 fighters in the northeastern corner of the country. They face a continued threat not just from ISIS but from their hostile neighbor to the north in Turkey and the Syrian regime, which has vowed to one day reclaim all its lost territory. The SDF also have tens of thousands of suspected ISIS members and their families in their custody, including some 70,000 women and children at a notorious compound in the Syrian city of al-Hol that has become a hotbed of ISIS recruitment.

Instead, Trump has left the SDF to an uncertain fate in the face of a Turkish invasion, threatening to upend their very existence. At the same time, the White House announced on Sunday that Turkey will take control of all the prisoners in SDF hands—an uncertain prospect given Turkey’s checkered history when it comes to cracking down on the militants.

Foreign fighters from around the world joined ISIS via the porous Turkey-Syria border. ISIS also sent terrorists to Europe on migrant routes from Turkey; at times, human traffickers have been allowed to operate these routes relatively unmolested. (In fact, Erdoğan has repeatedly used migrant flows as leverage in negotiations with Europe, issuing his most recent threat to “open the gates” last month.) As the ISIS caliphate collapsed, many of its members escaped from Syria into Turkey in search of safety. The idea that Turkey can successfully manage these prisoners, including the foreign fighters among their ranks, is dubious given its failures to crack down sufficiently on the ISIS cells and criminal and financial networks within its own borders.