Syrian President Bashar al-AssadJoseph Eid | AFP | Getty ImagesSyria’s Kurds said Syrian government forces agreed Sunday to help them fend off Turkey’s invasion — a major shift in alliances that came after President Donald Trump ordered all U.S. troops withdrawn from the northern border area amid the rapidly deepening chaos.The shift could lead to clashes between Turkey and Syria and raises the specter of a resurgent Islamic State group as the U.S. relinquishes any remaining influence in northern Syria to President Bashar Assad and his chief backer, Russia.Adding to the turmoil Sunday, hundreds of Islamic State families and supporters escaped from a holding camp in Syria amid the fighting between Turkish forces and the Kurds.The fast-deteriorating situation was set in motion last week, when Trump ordered U.S. troops in northern Syria to step aside, clearing the way for an attack by Turkey, which regards the Kurds as terrorists. Since 2014, the Kurds have fought alongside the U.S. in defeating the Islamic State in Syria, and Trump’s move was decried at home and abroad as a betrayal of an ally.Over the past five days, Turkish troops and their allies have pushed their way into northern towns and villages, clashing with the Kurdish fighters over a stretch of 200 kilometers (125 miles). The offensive has displaced at least 130,000 people.On Sunday, U.S. Defense Secretary Mark Esper said all American troops will withdraw from northern Syria because of the increasing danger of getting caught in the crossfire.”We have American forces likely caught between two opposing advancing armies, and it’s a very untenable situation,” he said on CBS’ “Face the Nation.” He did not say how many would withdraw or where they would go but that they represent most of the 1,000 U.S. troops in Syria.The peril to American forces was illustrated on Friday, when a small number of U.S. troops came under Turkish artillery fire at an observation post in the north. No Americans were hurt. Esper said it was unclear whether that was an accident.Trump, in a tweet, said: “Very smart not to be involved in the intense fighting along the Turkish Border, for a change. Those that mistakenly got us into the Middle East Wars are still pushing to fight. They have no idea what a bad decision they have made.”Later in the day Sunday, Kurdish officials announced they will work with the Syrian government to fend off the Turkish invasion, deploying side by side along the border. Syrian TV said government troops were moving to the north to confront the Turkish invasion but gave no details.The Kurdish fighters had few options after the United States abandoned them, and it had been anticipated they would turn to Assad’s government for support.A return by Assad’s forces to the region where Syrian Kurds have built up autonomy in the north would be a major shift in Syria’s long-running civil war, further cementing Assad’s hold over the ravaged country. Late Sunday, Syrian TV broadcast from the northern town of Hassakeh where residents took to the streets to celebrate the announcement of cooperation between the Syrian government and the Kurds, and many vowed to defeat the Turkish invasion.It would also mean that U.S. troops no longer have a presence in an area where Russia and Iranian-backed militias now have a role.It was not clear what Russia’s role was in cementing the agreement. But Russian officials have been mediating low-level talks between the Kurds and Damascus. Syria is allied with Russia, and Turkey, though it is a NATO member, has drawn close to Moscow in recent years under Turkish President Recep Tayyip Erdogan.The U.S. withdrawal leaves open the question of what happens to the Kurdish-run prisons and detention centers that hold thousands of Islamic State prisoners, including more than 2,000 foreign militants.On Sunday, heavy fighting reached a Kurdish-run displaced-persons camp in Ein Eissa, some 35 kilometers (20 miles) south of the border, that is home to some 12,000 people, including around 1,000 wives and widows of Islamic State fighters and their children.The Kurdish-led administration in northern Syria said in a statement that 785 Islamic State supporters escaped after attacking guards and storming the gates. It was not immediately possible to confirm that figure.”It gets worse by the hour,” Esper said of the fighting. “These are all the exact things” that U.S. officials warned Erdogan would probably happen in urging him not to invade.Erdogan on Sunday ruled out any mediation in the dispute with the Kurds, saying Turkey won’t negotiate with “terrorists.”Turkey’s official Anadolu news agency said Turkey-backed Syrian forces had advanced into the center of a Syrian border town, Tal Abyad, on the fifth day of Turkey’s offensive. Turkey’s Defense Ministry tweeted that its forces had taken control of the main highway running between Hassakeh, a major town and logistics hub, and Ein Eissa, the administrative center of the Kurdish-held areas.Casualties mounted. On Sunday, at least nine people, including five civilians, were killed in Turkish airstrikes on a convoy in the Syrian border town of Ras al-Ayn, according to the Syrian Observatory for Human Rights and Syrian Kurdish officials.Images of the attack showed bodies and severed limbs strewn in the street. Some of those killed appeared to be carrying guns. Activists said the gunmen were guarding the convoy.Turkey said 440 Kurdish fighters have been killed since the operation began Wednesday. The SDF said 56 of its fighters have died. Turkey also said four of its soldiers were killed, along with 16 allied Syrian fighters.