BEIRUT — Radical fighters staged a strategic retreat from a key Syrian town on the Turkish border Friday amid growing tensions with rival rebel factions that threaten to erupt in a new war.

The retreat from Azaz of the Islamic State of Iraq and Syria ended a five-month reign of terror by the renegade al-Qaida faction, which has used its position in the town to control access to Turkey and compromise supply routes for more moderate rebels.

It could also signal a new phase in the intra-rebel fighting that has pitted more moderate factions against extremists across northern Syria in the past two months, undermining the wider battle against forces loyal to President Bashar Assad.

The exit came a day ahead of a deadline issued by Jabhat al-Nusra, the official al-Qaida affiliate in Syria, for ISIS to cease confronting rival rebels or face a new war. Commanders speculated that the ISIS fighters, who have resisted previous attempts at mediation, chose to pull out from Azaz to reinforce strongholds elsewhere in preparation for further conflict.