Now, civilians are on the run again, but this time there are even fewer places to go. The northern border with Turkey is sealed, displacement camps are already overwhelmed and hostile forces, including unbowed IS militants, are poised to move in and exploit the chaos.
Here's a look at the refugee crisis in northeastern Syria amid fears it will dramatically worsen. FROM ONE WAR TO ANOTHER Syrian government forces largely withdrew from the northeast after the civil war erupted in 2011 to focus on other parts of the country. That allowed the Kurdish minority to carve out an autonomous region that welcomed refugees from the fighting in other parts of the country, including Christians and other religious minorities.
But the Islamic State group swept in starting in 2013 and eventually conquered most of the area, establishing the capital of its self-styled caliphate in the northeastern city of Raqqa. Tens of thousands of people fled the fighting and the group's brutal rule, which was marked by massacres, public beheadings and other atrocities.
The Kurdish-led Syrian Democratic Forces launched a counteroffensive after nearly being wiped out in the northeastern border town of Kobane. With close U.S. military support, they gradually retook nearly all of northeastern Syria from the extremists, including Raqqa. But victory came at a staggering cost, with tens of thousands killed and entire neighborhoods and towns left in ruins. Much of Raqqa was destroyed, and the city is still littered with undetonated explosive devices.
Now the Kurdish fighters are racing to the front lines once again, this time to fight Turkey, which considers them terrorists because of their links to the Kurdish insurgency inside its borders. Turkey has vowed to carve out a "safe zone" along the border extending 30 kilometers (20 miles) into Syria, where it plans to resettle some of the more than 3.5 million Syrian refugees it is hosting. But the offensive itself could generate a whole new wave of displacement.
"Hundreds of thousands of civilians in northern Syria are now in harm's way," said U.N. High Commissioner for Refugees Filippo Grandi. "Civilians and civilian infrastructure must not be a target."
FEW PLACES LEFT TO GO
As Turkey began launching airstrikes and artillery barrages along the border, lines of cars, trucks and motorized rickshaws could be seen racing down the main roads, loaded with families who had hastily packed their belongings into duffel bags and plastic sacks. The Norwegian Refugee Council estimates that some 450,000 people live within 5 kilometers (3 miles) of the border, including 90,000 who have already fled the civil war at least once.
The International Rescue Committee, another aid group that works in the region, says the fighting could displace up to 300,000 people, and that even a limited military operation could drive 60,000 from the border area. "Many of these people have already been displaced multiple times and suffered horribly under the brutal rule of (IS), only to be facing yet another crisis," it said.
There are few places left to run.
To the north, Turkey has largely sealed its border in recent years and no longer accepts refugees. To the east is Iraq, which is already hosting 250,000 Syrian refugees, 90,000 of them in camps that rely on international aid, according to the Norwegian Refugee Council. To the west is territory held by Syrian government forces and their Russian and Iranian allies. Refugees who have fled from government-held areas have been slow to return, fearing arrest or violent reprisal.
That leaves the south, which is dotted with devastated towns and cities, and camps that are already home to more than 108,000 displaced people.
"People living in displacement camps in northeast Syria are extremely vulnerable," said Karl Schembri of the Norwegian Refugee Council. "They live in overcrowded camps that are wholly reliant on assistance provided by aid agencies who are struggling to meet the needs."
The region has also seen a wave of attacks by IS remnants. Syrian Kurdish forces are holding thousands of IS fighters, including many foreigners, but say they may not be able to maintain their detention centers in the face of the Turkish onslaught. The escape of even a small number of those fighters could hasten another resurrection of the extremist group, which in different forms has survived past setbacks dating back to the U.S. war in Iraq.
A PROLONGED CONFLICT
Turkey has been threatening a massive operation for months but had been restrained in part by U.S. opposition to any assault on Washington's Kurdish allies. Those concerns appear to have evaporated over the weekend, when President Donald Trump, saying he wanted out of America's "stupid endless wars," gave a green light to Turkish President Recep Tayyip Erdogan and began pulling back from border posts some of the more than 1,000 U.S. troops based in northeastern Syria as part of the fight against IS.
That decision has been widely condemned by Democrats and many Republicans, including some close Trump allies. The mercurial Trump has reversed himself on Syria before and may intervene to try and stop the operation if the violence escalates. But it's also possible that Turkey will try to eliminate the SDF once and for all, bringing the fighting deep inside Syria.
Waiting in the wings are forces loyal to Syrian President Bashar Assad, who has repeatedly vowed to bring the entire country back under his control.
Krauss reported from Ramallah, West Bank.