Al-Qaida militants seized a town near the Turkish border Thursday after expelling Western-backed rebels from the area, demonstrating the growing power of jihadis as they seek to expand their influence across opposition-held Syrian territory.

The infighting — now engulfing many parts of northern Syria — threatened to further split opposition forces outgunned by President Bashar Assad’s troops and strengthen his hand as he engages with world powers on relinquishing his chemical weapons.

Opposition forces who had been hoping that U.S.-led military strikes would help tip the balance in the civil war are growing increasingly desperate after the Obama administration shelved those plans in favor of a diplomatic solution.

Many rebels blame jihadis in their ranks for the West’s reluctance to intervene militarily in Syria or give them the advanced weapons they need. There is also growing concern that the dominant role the extremists are playing is discrediting the rebellion.

Yet the jihadis, including members of the Islamic State of Iraq and the Levant, an al-Qaida offshoot, have been some of the most effective forces on the battlefield, fighting alongside the Western-backed Free Syrian Army to capture military facilities, strategic installations and key neighborhoods in cities such as Aleppo and Homs.

But the two sides have turned their guns on each other. Turf wars and retaliatory killings have evolved into ferocious battles in what has effectively become a war within a war in northern and eastern Syria, leaving hundreds dead on both sides.

“The moderates realized that they’re losing a lot of territory to the Islamists and jihadi fighters, and so they’re more desperate,” said Aaron Zelin, a fellow at the Washington Institute for Near East Policy.

The battles for control of Azaz, a town only few kilometers from the Turkish border, represents some of the worst infighting in recent months.

Members of ISIL overran the town Wednesday evening, killing several fighters from the Free Syrian Army rebel umbrella group, before forcing them to pull out.

Amateur video showed dozens of gunmen with heavy machine guns on pickup trucks gathering at the border with Turkey with reinforcements. The Associated Press was able to verify the footage based on interviews and other reporting on the events depicted.

A relatively moderate Islamist group with influence in the region, the al-Tawheed brigade, was mediating Thursday to get the al-Qaida-linked militants to leave Azaz, but fighting was continuing.

The prospect of al-Qaida militants so near the frontier is worrisome for the Turkish government, which closed the nearby border crossing of Bab al-Salameh, according to a Foreign Ministry official speaking on condition of anonymity.

Assad told Fox News Channel the balance of opposition forces has shifted in the more than two-year conflict, and he alleged that 80 percent to 90 percent were members of al-Qaida or its affiliates.

“At the very beginning, the jihadists were the minority. At the end of 2012 and during this year, they became the majority with the flow of tens of thousands from additional countries,” he said.