Thousands of Syrian refugees poured into Turkey on Sunday to escape the battle between Kurds and Islamic State (IS) jihadists for the Syrian town of Tal Abyad, as the Turkish authorities reopened the border after days of closure.

The Syrians, many carrying sacks of possessions and small children, flooded through the Akcakale border gate onto Turkish territory, an AFP photographer said.

There had earlier been chaotic scenes as some of the refugees crossed the border illegally through holes in fences, prompting rapid intervention from the Turkish army.

Turkey had for several days been blocking the Syrians from entering Turkey, saying it would only allow them into the country in the event of a humanitarian tragedy.

However, local officials in Akcakale said earlier that permission had been received from Ankara to allow the refugees into Turkey.

The decision came as Kurdish forces advanced on Tal Abyad, which is controlled by the IS group that has captured swathes of Syria and Iraq.

A delay followed which Turkish television said was due to IS jihadists trying to stop the refugees from crossing the border into Turkey.

Chaos ensued with some Syrians managing to push their way through the fences away from the main Akcakale border gate to enter Turkey illegally.

Some squeezed under the mesh-wire barrier while others managed to climb over, throwing their bags over the fence.

They then had to negotiate the border trench with dozens managing to scramble across. The army used water cannon and tear gas in a bid to restore control.

But in the early evening Turkish authorities opened the Akcakale border gate and the refugees began to enter in an orderly fashion.

Many had relatives already waiting for them on the other side. The queue of refugees could be seen extending up the hillside.

– ‘Open-door policy’ –

With temperatures above 35 degrees Celsius, Turkish emergency workers threw bottled water into the crowds as dozens of hands stretched out to catch them.

The refugees were then registered with the Turkish authorities, receiving vaccinations and health checks.

Those with relations already in Turkey can stay with them, others will be taken to existing refugee camps, the Dogan news agency said.

Turkish television said that in all 3,000 people were expected to cross over into Turkey but the AFP correspondent at the scene said the numbers appeared considerably greater.

Under an “open-door” policy championed by President Recep Tayyip Erdogan, Turkey has taken in 1.8 million Syrian refugees since the conflict in Syria erupted in 2011.

But the Turkish government has in recent months grown increasingly frustrated with the situation, claiming that it has been left to shoulder the burden of refugees while the West stands by.

The government said in April that it had spent almost $5.5 billion (4.8 billion euros) to provide for Syrian refugees.

Before last week’s border closure, Turkey had taken in more than 13,500 Syrian refugees escaping the fighting for Tal Abyad, officials said.

Turkish officials have said that the refugees are mainly ethnic Arabs and Turkmen.

Erdogan said earlier he was troubled by the advance of Kurdish forces to Tal Abyad, saying they could in the future threaten Turkey.

He said the places refugees had vacated were being occupied by the Syrian Kurdish group the Democratic Union Party (PYD) and the outlawed Kurdistan Workers Party (PKK).

“This is not a good sign,” he said. “This could lead to the creation of a structure that threatens our borders.”