Thousands of migrants may be in no man’s land between Turkey and Greece after Ankara opened its western borders, sparking chaotic scenes as Greek troops attempted to prevent refugees from entering Europe en masse.

Turkey’s president, Recep Tayyip Erdoğan, claimed 18,000 migrants had crossed the border, without immediately providing supporting evidence, but many appear to have been repelled by Greek border patrols firing teargas and stun grenades.

Erdoğan has long threatened to allow refugees and migrants transit into the EU, with which Turkey signed an accord in 2016 to stem westward migration in return for financial aid.

He stressed the frontier would remain open. “We will not close these doors in the coming period and this will continue,” he said in Istanbul on Saturday. “Why? The European Union needs to keep its promises. We are not obliged to look after and feed so many refugees. If you’re honest, if you’re sincere, then you need to share.”

Erdoğan complained that funds transferred to Turkey from the EU to support refugees were arriving too slowly, saying he had asked Angela Merkel, the German chancellor, to send them directly to his government.

But the policy shift appears to be intended to force the EU and Nato to support Ankara’s new military campaign in the north-western province of Idlib, Syria’s last rebel stronghold, where thousands of Turkish soldiers are supporting opposition forces facing an onslaught from regime forces backed by Russian air power.

Erdoğan said Turkey could not handle a new wave of migration, in an apparent reference to the growing humanitarian crisis in Idlib.

The Idlib offensive has pushed almost a million displaced civilians toward the Syrian-Turkish border, and hundreds of thousands of Syrian civilians remain between advancing Syrian government forces backed by Russia and rebel fighters supported by Turkey.

In the largest single loss of life to Turkish forces since their country became involved in the Syria conflict, at least 33 Turkish soldiers were killed in an airstrike on Thursday night.

After officials briefed on Friday that police, coastguard and border guards had been ordered to stand down, meaning passage to Europe would be no longer prevented, thousands of refugees and migrants made haste to Turkey’s borders with Greece and Bulgaria. Many travelled on buses provided by the Turkish state.

They were met by Greek border patrols reportedly firing teargas and stun grenades. Some young migrants and refugees appeared to hurl rocks at the guards.

Refugees and migrants at the Turkish-Greek border at Edirne. Photograph: Erdem Şahin/EPA

“A titanic battle [is being waged] to keep our frontiers closed,” said Panayiotis Harelas, who heads the federation of border guards during an impromptu press conference at the scene.

A 17-year-old Iranian who had made it into Greece overnight along with a group of friends told the Associated Press he had spent two months in Turkey and could not sustain himself there. “We learned the border was open and we headed there,” he said. “But we saw it was closed and we found a hole in the fence and went through it.”

Greek authorities said 52 ships were patrolling the seas around Lesbos, along with other Aegean isles, in an apparent show of force to deter clandestine voyages. Greece has also bolstered its eastern land border, while Bulgaria has sent an extra 1,000 troops to its border with Turkey.

A Greek government spokesperson, Stelios Petsas, said after an emergency meeting of ministers that security forces had repelled “more than 4,000 illegal entries”. Sixty-six people had been arrested after making their way through forest land into the country, none of whom were believed to hail from Idlib, according to Petsas.

On Saturday morning high winds on Lesbos were mostly preventing arrivals there, with just one boat containing 27 people from various African countries reported to have reached the island. Another 180 reached other Greek islands from Turkey between Friday morning and Saturday morning, according to the coastguard.

There are more than 3.5 million Syrian refugees in Turkey, along with many others fleeing war and poverty in Asia, Africa and the Middle East. Turkey’s borders to Europe were closed to migrants following a £5.2bn deal with the EU in 2016 after more than a million people crossed into Europe by foot.

As that policy was effectively reversed, Erdoğan claimed that the number of people entering Europe from Turkey could rise to up to 30,000 on Saturday.

He also said he had told Vladimir Putin, the Russian president, to end his support for Bashar al-Assad’s regime in Syria so that Turkey could more easily battle Assad’s forces.

“We did not go [to Syria] because we were invited by [Assad],” he said. “We went there because we were invited by the people of Syria. We don’t intend to leave before the people of Syria [say] OK, this is done.”

Syrian and Russian warplanes kept up airstrikes on the strategically important Idlib city of Saraqib on Saturday, according to the Syrian Observatory for Human Rights. There were reports that nine Assad-supporting Hezbollah forces were killed by Turkish smart missiles and drones.

Russia’s foreign ministry said on Saturday that the two sides had agreed this week to reduce tensions on the ground in Idlib, though military action will continue, after Nato envoys held emergency talks at the request of Turkey, a member of the alliance.

While urging de-escalation in Idlib, Nato offered no immediate assistance but said it would consider strengthening Ankara’s air defences.

The UN secretary general, António Guterres, called for an immediate ceasefire and said the risk of ever greater escalation was growing by the hour, with civilians paying the gravest price.