BEIRUT, Lebanon — An extremist group linked to Al Qaeda routed Syrian rebel fighters and seized control of a gateway town near Syria’s northern border with Turkey on Wednesday, posting snipers on rooftops, erecting checkpoints and imposing a curfew on the local population.

The takeover of the town, Azaz, by fighters from the Islamic State in Iraq and Syria, or ISIS, reflected the rising strength of extremist fighters in northern and eastern Syria and their rapidly deteriorating relations with more mainline rebels.

By early Thursday, Islamist rebel leaders had intervened to stop the fighting, although most of the town appeared firmly in the hands of the extremists, opposition activists said. The extremists had not seized the nearby Bab al-Salameh border crossing with Turkey. Azaz sits just south of the border crossing on the road to Aleppo, Syria’s largest city, and has served as an important artery for the rebellion in northern Syria, allowing arms, fighters and supplies to move in and refugees fleeing the violence to leave the country.

Its seizure is likely to alarm Syria’s neighbors. Turkey, which has vocally supported the fight against forces loyal to President Bashar al-Assad and allowed fighters and arms to flow freely across its southern border, now faces a bold Qaeda affiliate.