Al-Qaeda-linked militants seized a key northern Syrian town from rebels on Wednesday, as mounting friction between anti-­government extremists and more moderate, Western-backed opposition factions erupted into all-out conflict.

The town of Azaz, two miles from the Turkish border, was overrun by fighters from the Islamic State of Iraq and the Levant after clashes broke out at the main hospital there. The fighting began when the al-Qaeda-linked group attempted to detain a German doctor, according to medics and activists.

The fall of the town, which lies on the road between the border crossing of Bab Salameh and the northern city of Aleppo, has the potential to disrupt rebel supply lines. The crossing itself, one of the few between Syria and Turkey that are still functional, remained in the hands of the more moderate Free Syrian Army on Wednesday night, despite reports that Islamic State was mounting an offensive to take it.

Although both mainstream opposition forces and al-Qaeda-linked fighters are battling the government of President Bashar al-Assad, the extremists have focused their energies lately on attacking their fellow rebels. Tensions between Islamic State and other rebel factions have been building since the group emerged on the ground earlier this year. It declared war on two mainstream rebel groups last week in what it labeled operation “cleansing evil.”

“There is a huge expansion of the Islamic State in Iraq and the Levant,” said Col. Malik al-Kurdi, a senior commander in the Free Syrian Army, who said the extremists had also recently seized the town of Kafarnaje. With Islamic State well-financed and armed, “the FSA power is in reversal,” he said.

The escalation of conflict between mainstream rebel groups and Islamic State is likely to further bolster Assad’s position as his government steps up its operations.

“Now the conflict is internal, and it’s the regime that is benefiting,” Kurdi said.

Wednesday’s fighting broke out at Azaz’s al Ahli hospital when Islamic State fighters attempted to detain a doctor, medical staff and activists said. The Northern Storm Brigade, a more moderate rebel group that controlled the hospital, refused.

“They claimed they wanted to take him for interrogation, but Northern Storm wouldn’t allow it. This is when the clashes started,” said Abel Hamid al-Hussain, a doctor who works in a hospital about five miles away and who treated four of the wounded.

Hussain said that the Syrian-German doctor was working with a German charity and that his fate was unknown. A nurse was also detained, Hussain said.

As the clashes expanded, Northern Storm retreated from the town. Activists said that dozens were arrested and that at least five people were killed, including the head of the opposition media center in the town, who was caught in sniper fire.

There were fears of further conflagration as the night wore on, as another rebel group amassed its forces to try to retake the town, activists said.

Islamic State’s ascendancy has been accompanied by a sharp decline in security in the country’s north, with medics and journalists becoming the target of attacks and kidnappings.

Islamic State’s offensive comes after a lull in activity for the group as it lay low, fearing that it could be targeted in U.S. airstrikes. Any possible U.S. airstrikes on targets in Syria have been put on hold as world powers negotiate over the fate of the country’s chemical weapons program.