People inspect a site hit by an airstrike in the rebel held area of Aleppo's al-Sukari district, Syria, May 30, 2016. REUTERS/Abdalrhman Ismail

BEIRUT (Reuters) - Civilians fleeing an Islamic State offensive in northwestern Syria have been prevented by Syrian Kurdish authorities from entering areas under their control in response to rebel shelling of a Kurdish-held area of Aleppo, the United Nations said.

The civilians have been fleeing fighting between Syrian rebels and the Islamic State group that advanced into the opposition-held town of Marea at the weekend, a significant advance by the jihadists against Turkish-backed insurgents.

The United Nations has expressed concern about an estimated 8,000 Syrians trapped by fighting in northern Aleppo.

All the main parties to the Syrian war are fighting in the Aleppo area, and the Turkish-backed rebels who are battling Islamic State north of the city have also been involved in hostilities with the Syrian Kurdish YPG militia, which controls wide areas of territory to the west of Marea.

A situation update from the U.N. Office for the Coordination of Humanitarian Affairs (OCHA) said about 2,000 people had managed to evacuate Marea and nearby Sheikh Issa, which were encircled by Islamic State on May 27.

“However, an estimated 7,000 civilians still remain inside and unable to leave due to restrictions imposed by Kurdish authorities,” it added, saying that was a Kurdish response to rebel shelling of Aleppo’s Kurdish-held Sheikh Maqsoud area.

Meanwhile, opposition authorities in the rebel-held town of Azaz near the Turkish border have issued a directive to not let in any more people fleeing Islamic State-held areas.

The court that issued the order cited fears of infiltration by covert Islamic State militants posing as internally displaced people (IDPs), after 8,000 IDPs arrived in Azaz, OCHA said.