Thousands of Syrians cut through a border fence and crossed over into Turkey on Sunday, fleeing intense fighting in northern Syria between Kurdish fighters and jihadis.

The flow of refugees came as Syrian Kurdish fighters closed in on the outskirts of a strategic Islamic State-held town on the Turkish border, Kurdish officials and an activist group said, potentially cutting off a key supply line for the extremists' nearby de facto capital.

Taking Tal Abyad, some 50 miles north of the Islamic State stronghold of Raqqa, would deprive the militant group of a direct route to bring in new foreign militants or supplies. The Kurdish advance, coming under the cover of intense U.S.-led coalition airstrikes in the area, would also link their two fronts and put even more pressure on Raqqa.

In this Turkish border village, the refugees took by surprise the Turkish troops stationed there, who were overwhelmed by the large number of people crowding the crossing. Thousands of people had been gathering for more than a day on the Syrian side of the Akcakale border crossing before they broke through Sunday afternoon.

People threw their belongings over the fence while others passed infants into Turkey over barbed wires before following through a several-meter wide opening in the border fence.

Turkish troops later brought in reinforcements and gathered up the refugees on the Turkish side of the border, preventing them from going deeper into Turkey.

Earlier Sunday, Turkish Deputy Prime Minister Numan Kurtulmus speaking on the refugee situation at the crossing between in Tal Abyad and Akcakale, claimed that those refugees were not fleeing fighting between Kurds and the Islamic State group, but were rather trying to escape to Turkey in case their villages are hit by U.S.-led coalition bombings.

He said Turkey was providing humanitarian aid to them on the other side of the border while taking in anyone who is sick or injured. Kurtulmus said Turkey has taken in more than 2 million refugees since 2011.

"We are of the opinion that there isn't a humanitarian tragedy there," Kurtulmus told CNN-Turk television in an interview. "Our priority is for them to remain within their border. We will continue to provide humanitarian aid to them"

Hours after Kurtulmus spoke, Turkey reversed its decision and opened the border to allow more of the refugees in, the state-run Anadolu Agency reported. It said however that this time, Islamic State group militants at the border prevented them from crossing into Turkey.

It put the number of people who were waiting to cross at around 2,500. Around 13,400 Syrians have fled to Turkey since June 1, the agency said.

On Sunday, Kurdish official Idriss Naasan said that Islamic State fighters have fled from Suluk, a few miles southwest of Tal Abyad, and that Kurds now hold the town. The Britain-based Syrian Observatory for Human Rights also said Islamic State fighters had withdrawn. The Observatory said the Kurds are about 3 miles from Tal Abyad.

The Observatory reported later that Kurdish fighters captured more villages near Tal Abyad on Sunday adding that jihadis blew up to bridges southeast and southwest of the town to prevent them from pushing forward.

"It's only a matter of time before this area is liberated," Naasan told The Associated Press by telephone from northern Syria, saying the Kurds surround Tal Abyad from the east, west and south. The Turkish border -- and the soldiers there -- now hem the extremists in from the north.

However, Rami Abdurrahman, who heads the Observatory, said Islamic State fighters still control the road linking the Turkish border with Raqqa.

Brett McGurk, the U.S. deputy special presidential envoy for the global coalition to counter the Islamic State group, told NBC's "Meet the Press" program on Sunday  that Kurdish fighters and other units in Syria are scoring major territorial gains against the Islamic state group.  Using an alternative acronym for the group, McGurk said the Kurdish fighters are "really giving a beating to ISIS and they're very close to cutting off the main supply route that ISIS has into its capital of Raqqa."

Since the beginning of May, members of the main Syrian Kurdish force, the People's Protection Units, or YPG, have taken more than 200 small Kurdish and Christian towns in northeastern Syria, as well as strategic mountains seized earlier by the Islamic State group.

They have pushed into Raqqa province, a stronghold of the Islamic State group. Along the way, they have picked up ammunition, weapons and vehicles left behind by the jihadis, almost mirroring the way the extremists overran Iraqi positions last year in their sweep across a third of that country.

The Islamic State group has declared areas of Syria and Iraq it holds as part of its self-declared caliphate, demanding the loyalty of the world's Muslims. Their gruesome propaganda videos of mass killings have drawn in foreign fighters, many coming in over the border from Turkey.

Even if the Kurds cut off Tal Abyad from Raqqa, the Islamic State group could bring in fighters across the border in Syria's Aleppo province, where they still hold ground. However, that would be an indirect route that could expose them to other fighting amid the long Syrian civil war against President Bashar Assad.

In Syria, a country now split mostly between Islamic militants and forces loyal to Assad, the U.S. has found a reliable partner in the YPG, the country's strongest Kurdish militia. They are moderate, mostly secular fighters, driven by revolutionary fervor and a desire to eventually have a nation of their own carved out in the region.

U.S. airstrikes continued Sunday in the area, as an Associated Press journalist on the Turkish side of the border from Tal Abyad saw one strike east of the town.

Nasser Haj Mansour, a defense official in Syria's Kurdish region, said YPG officials are coordinating with the U.S.-led coalition regarding a possible attack on Tal Abyad. He added that the aerial coverage prevented the Islamic State group from bringing reinforcements to the area.