BEIRUT, Lebanon — Syrian opposition fighters on Wednesday said that they had gained back the territory they lost near the divided northern city of Aleppo a day earlier, when government forces carried out a surprise attack in an effort to cut off their main supply route to Turkey.

Casualties were reported to be heavy on both sides in the battle for an area north of the city where insurgents have been trying to prevent pro-government forces from completely encircling Aleppo and besieging rebel-held areas.

The attack came just before the United Nations special envoy, Staffan de Mistura, told the Security Council that the government of President Bashar al-Assad had agreed to temporarily halt fighting in Aleppo.