BEIRUT — Al-Qaeda-linked fighters in Syria have in recent days forced their rivals’ surrender in the country’s final rebel-held pocket, cementing control while increasing the likelihood of a ruinous showdown with Syrian government forces.

Hayat Tahrir al-Sham, or HTS, a coalition of extremist fighters in the northern province of Idlib, said this month that its most powerful rivals had agreed to cede control of their strongholds and hand the administration over to a local authority backed by the Islamist militants. The announcement followed a week-long drive by the extremists to oust what was left of their opponents, seizing a string of towns through force and surrender negotiations.

The takeover could precipitate an offensive by the Syrian government aimed at recapturing the province, in turn prompting a humanitarian catastrophe as hundreds of thousands of people flee toward the Turkish border.

Until now, the area has been spared a potentially devastating government offensive thanks to a cease-fire deal in the fall between Russia and Turkey, which both have forces inside Syria.

Their agreement stipulated that “radical terrorist groups” be removed from a buffer zone between Syrian government and opposition forces with the implicit understanding that Turkey — the rebels’ primary backer — would be the one to achieve that.

It never happened. With Turkey unable or unwilling to remove the militants, they flourished instead. The result is something highly unusual: an extremist-controlled statelet guaranteed, at least for the time being, by international powers.

While Idlib is a rare haven for al-Qaeda-linked extremists, they remain primarily focused on the local fight instead of planning and launching attacks beyond northern Syria.

“The gravest threat from Idlib seems not to be the area’s continued existence — rather, it’s Idlib’s end,” said Sam Heller, a senior analyst with the Brussels-based International Crisis Group. “The fear is that if the Syrian military and its allies march into Idlib, then a lot of dangerous people currently inside Idlib will scatter in all directions.”

Although HTS is an outgrowth of Syria’s al-Qaeda affiliate, known previously as the Nusra Front, the nature of its ties to al-Qaeda remain murky.

Residents interviewed across the newly captured areas voiced deep unease. Some feared torture and arrest by HTS. Others feared more for the future that would await them once government forces took over.

After almost eight years of war and half a million deaths, the Syrian government has regained all but one of the armed opposition’s strongholds. That has left the once-quiet Idlib and its surrounding areas bursting at the seams with some 3 million civilians and fighters who still reject government control. And with Turkey’s border sealed shut to the north, those people could have nowhere to run.

“We do not feel safe,” said one man in the town of Atareb, speaking on the condition of anonymity to not provoke the wrath of the militants. “They are like the secret police; they will take anyone who criticizes them. Then the longer they rule us, the more we must fear a final attack.”

HTS announced this month that shops across the region would be required to stay closed during the weekly midday prayers. On closed WhatsApp groups, the militants also circulated recruitment advertisements, listing contact numbers and locations in which military training would begin on Jan. 25.

The self-proclaimed Salvation Government, an HTS-dominated body, will control most of Idlib, as well as parts of the neighboring Aleppo and Hama regions. 

Those areas include portions of two strategic highways that Syrian government forces have in their sights. The group’s control of transport routes could have disastrous implications for those relying on international aid to survive.

“Residents of rebel-held Idlib are incredibly worried aid will be cut off now that HTS controls all major roads and border crossings,” said Elizabeth Tsurkov, a Washington-based research fellow at the Forum for Regional Thinking. “Even before HTS’s takeover, U.S. counterterrorism controls on aid provision were making the provision of assistance incredibly complex,” she said. Under international restrictions, it is illegal for aid to reach HTS because it is a prescribed terrorist group.

The World Health Organization warned last year of rising acute levels of malnutrition in Idlib, saying that as many as 1.6 million were reliant on food assistance. One local aid worker interviewed last week, speaking on the condition of anonymity out of fear for his safety, said a reduction in aid could mean the difference between “life and death” for some families.

Hundreds of rebel fighters began evacuating their former strongholds Monday, having laid down their heavy weaponry as a condition of their surrender. Most were believed to be heading for the Turkish-controlled enclave of Afrin, a formerly Kurdish-dominated area that has increasingly become home to Syrian Arabs displaced as government offensives have retaken their hometowns across the country. 

With HTS fully in control, analysts and Western diplomats say the area’s cease-fire is hanging in the balance. 

The Syrian Observatory for Human Rights, a Britain-based monitoring group, said Monday it continued to track cease-fire violations by the Syrian army, as well as clashes involving opposition gunmen. Turkish officials said this weekend they had met in the southern province of Hatay to discuss the situation. 

“All efforts are being made to maintain cease-fire, stability under Sochi agreement,” Hulusi Akar, Turkey’s defense minister, said on Saturday, referring to the Black Sea resort town where the cease-fire deal was struck. “Our close cooperation with Russia continues in this manner.”

Turkey had focused on trying to peel away more moderate elements of the group, leaving the most extreme fighters isolated. But HTS was already ascendant.

“Even before it took this sort of outright control over the northwest, HTS was operating from a position of clear strength,” said Heller, of the International Crisis Group. “The group controlled the most strategic, populous and lucrative parts of the Idlib de-escalation zone, and it was understood to be the strongest, mostly militarily capable force.”

In interviews with civilians, the same Arabic phrase arose time and again. They were, they said, “trapped between two fires.”

“It’s extremists on one side and the regime on the other,” the aid worker said. “What did we do to deserve this? I don’t recognize my country anymore.”

Zakaria Zakaria in Istanbul contributed to this report.