A Turkish official says the country has opened its border with Syria to allow up to 4,000 people, mostly Kurds, to cross to safety as they flee militants from the Islamic State group.

Izzettin Kucuk, the governor of Sanliurfa province, says Turkey decided to permit the Syrians to cross over Friday after reports emerged that militants were closing in on their communities. A day earlier, Turkish authorities refused entry.

The Islamic State group has taken over more than 20 Kurdish villages since Wednesday in northeastern Syria as the extremists try to crush one of the last pockets of resistance against their rule there, the Kurdish-controlled area known as Kobani.

Turkey is already home to nearly 850,000 registered Syrian refugees.