A Syrian woman asks about the possible opening of a closed Turkish border crossing last year. Many trying to escape Syria are stuck there. (Lefteris Pitarakis/AP)

They came from every corner of Syria: people who fled fighting but could not afford smugglers’ fees to go farther.

Now nearly 1 million are packed into one province in Syria’s northwest, eyeing a weeks-old cease-fire there with trepidation, fear and mistrust.

This vast and often hilly expanse along Turkey’s southern border has become the rebels’ final redoubt. In the coming months, it could become the sternest — and the bloodiest — challenge for Syrian President Bashar al-Assad’s forces as they battle to control areas they lost to rebel fighters after the country’s 2011 uprising.

A deal brokered by Russia, Turkey and Iran this month has stopped much of the violence in Idlib province and three other regions of Syria. But if the truces break down and fighting resumes, the stakes will be highest in the northwest: The Turkish border is tightly controlled, and pro-government forces have been closing in for months. Across the province, a coalition of al-Qaeda-linked rebels would be firmly in Assad’s crosshairs, with hundreds of thousands of civilians stuck in the middle.

From his tent in a packed displacement camp along the Turkish border in the days before the deal, Qassim Qadoor called his children close as a drone hovered overhead. When it dropped its payload, he said, they ran for cover, passing the flames that savaged their neatly stacked possessions and destroyed the latest refuge for dozens of families just like them.

“We came here because there was nowhere left to go,” Qadoor said in a phone interview after the attack. His family had been uprooted nine times since the start of Syria’s conflict before arriving at the camp.

“The borders are closed, the regime is coming,” Qadoor said.

The seven-year war has scattered more than 5 million refugees around the world. Inside Syria, even more people who want to leave are trapped.

Already struggling to accommodate earlier refugees, Turkey, Lebanon and Jordan have mostly closed their borders. Crossing east into Iraq risks a perilous journey through Islamic State territory. So the displaced live in permanent flux, doing what they can to outrun the violence and to make ends meet when they arrive at their next destination.

As Syria’s war between pro-government forces and rebels reaches its endgame, Idlib has become a dumping ground for militants who have refused to surrender to the government elsewhere in the country.

The province’s population has swelled under deals brokered by Assad’s government, as civilians and fighters have been bussed northward from rebel-held areas across Syria that have submitted to government control in recent months.

Residents say new arrivals are packed into every last space. Apartment buildings are full and rents sky-high. Many families live in tents, mud houses or even caves.

Their schools, hospitals and amenities are run by a patchwork of rebel groups and opposition-backed local councils. But analysts and diplomats say the ascendant force across the province is the al-Qaeda-linked Tahrir al-Sham.

“They don’t shy away from throwing their weight around and exercising force and coercion against other factions,” said Sam Heller, a fellow with the Washington-based Century Foundation. “I don’t think there is any other faction that can muster the will to really challenge and reverse that dominance.”

Footage broadcast last week by the Dubai-based Al Aan television channel appeared to show fighters from al-Qaeda-linked groups manning checkpoints along main roads and trucks carrying prisoners to sharia courts and underground prisons.

There are also persistent reports that the groups have hijacked aid supplies.

“There have been kidnappings, hijackings. They’re extremists here. We didn’t lose our brothers for this vision of Syria,” one rebel fighter said, speaking on the condition of anonymity because of concern for his safety. “The country we were fighting for is not what we found here.”

Turkish officials insist that their country has maintained an “open door” policy for Syrian migrants throughout the war. But civilians say it has never been more difficult to cross.

Fearing infiltration by Islamic State militants, Turkish President Recep Tayyip Erdogan’s government has replaced flimsy border fences with a 10-foot concrete wall.

Human rights groups, including Amnesty International and Human Rights Watch, say Turkish border guards have shot and beaten civilians caught crossing illegally.

For most people, the only way out is with a smuggling network charging extortionate prices — or in an ambulance in the aftermath of an attack.

The wounded are scattered throughout southern Turkey. In the city of Reyhanli, a 23-year-old former grocer remembered little between the rocket that shattered his home last month and the moment he woke up in a hospital. Both of his legs had been amputated.

“You’ve come here to ask me why I stayed, but what choice did I have? We didn’t have the money to move closer to the border. And even if we had, what was it for? We’d just have been trapped again,” said the man, who gave his name as Nidal.

If pro-government forces tried to retake Idlib, they would face a grinding fight that would probably result in heavy casualties, especially among civilians.

“If, or when, the offensive on Idlib comes, it is the civilians who are going to be in the crossfire,” Heller said. “The jihadists are equipped to transfer to insurgent-style warfare. Once the bombing starts in the northwest, it will be civilians who are terrorized and die.”