BEIRUT (AP) — Over several nights in September, some 10,000 men, women and children fled areas under Islamic State control, hurrying through fields in northern Syria and risking fire from government troops to reach a province held by an al-Qaeda-linked group.

For an untold number of battle-hardened jihadis fleeing with the civilians, the escape to Idlib province marked a homecoming of sorts, an opportunity to continue waging war alongside an extremist group that shares much of the Islamic State’s ideology — and has benefited from its prolonged downfall.

While the US-led coalition and Russian-backed Syrian troops have been focused on driving IS from the country’s east, an al-Qaeda-linked insurgent coalition known as the Levant Liberation Committee has consolidated its control over Idlib, and may be looking to return to Osama bin Laden’s strategy of attacking the West.

Syrian activists with contacts in the area say members of the Levant Liberation Committee vouched for fleeing IS fighters they had known before the two groups split four years ago and allowed them to join, while others were sent to jail. The activists spoke on condition of anonymity because they still visit the area and fear reprisals from the jihadis.

IS has lost nearly all the territory it once controlled in Syria and Iraq, including the northern Iraqi city of Mosul — the largest it ever held — and the northern Syrian city of Raqqa, which once served as its de facto capital. Tens of thousands of its fighters have been killed on the battlefield, but an untold number have escaped. As it gradually disintegrates, theological splits have also emerged within the organization, including the rise of a faction that blames its leader, Abu Bakr al-Baghdadi, for the setbacks.

“Al-Qaeda will welcome ISIS members with open arms, those are battled-hardened with potent field experience,” said Fawaz Gerges, a professor at the London School of Economics and the author of “ISIS: A History.”

ISIS is an alternative acronym for the Islamic State group.

The two groups both sprang from al-Qaeda in Iraq, which emerged in the years after the 2003 US-led invasion, but split over ideology and leadership in 2013 and battled each other across northern Syria. Earlier this month, IS attacked the Levant Liberation Committee again, in what was seen as a revenge attack after the defections.

While IS went on to carve out a proto-state in large parts of Syria and Iraq and declared an Islamic caliphate in 2014, the al-Qaeda militants allied themselves with other Syrian insurgent groups and cultivated grass-roots support by providing aid and other services to civilians. They remained focused on the war against Syrian President Bashar Assad’s forces, although they’ve also crushed several small US-backed rebel factions.

But despite formally severing ties with al-Qaeda last year and repeatedly changing its name, the group is still widely seen as a loyal affiliate of the global network that carried out the September 11 attacks. Brett McGurk, the top US envoy for the coalition battling the Islamic State group, has said Idlib is the largest al-Qaeda haven since bin Laden’s days in Afghanistan.

“I worry that al-Qaeda has taken advantage of the past three or four years to very quietly rebuild while ISIS has preoccupied our attention,” said Bruce Hoffman, head of Georgetown University’s security studies program and author of “Inside Terrorism.”

“This is in al-Qaeda’s DNA, to either absorb, wait out or forcibly deal with any of their rivals so that they’re the last man standing.” The growth of the Levant Liberation Committee in the past year “has really astonished me,” he added.