Greek police fired teargas to push back hundreds of stone-throwing migrants trying to cross over the border from Turkey on Saturday, as a crisis over Syria shifted onto the European Union's doorstep.
Greece, which has tense relations with Turkey, accused Ankara of sending the migrants to the border post in an organised "onslaught" and said it would keep them out.
The EU said it was actively supporting Greece - and its neighbour Bulgaria, which also shares a border with Turkey - in protecting the bloc's borders, but also sought to appease Ankara.
The crisis is the first big policy test for Greek Prime Minister Kyriakos Mitsotakis, who was elected in July and promised a tougher stance on immigration.
Turkey said on Thursday it would no longer contain hundreds of thousands of asylum seekers after an air strike on Idlib in neighboring Syria killed 33 Turkish soldiers.
Convoys of people appeared heading towards the land and sea borders of Greece, which was a primary gateway for hundreds of thousands of asylum seekers into Europe in 2015 and 2016.
"They (the migrants) didn't come here on their own. They are being sent away and being used by (our) neighbour, Turkey," Greek Public Order Minister Michalis Chrysohoidis told reporters.
Government spokesman Stelios Petsas, referring to the build-up of migrants which started on Friday, said: "Greece yesterday faced an organised, mass and illegal attempt to violate its borders and it withstood this attempt."
Turkey hit back at the Greek accusations.
"Look who's lecturing us on international law! They’re shamelessly throwing tear gas bombs on thousands of innocents piled at their gates," Turkish Foreign Minister Mevlut Cavusoglu tweeted, along with pictures of hundreds sitting outside the Greek border post.
"We don't have an obligation to stop people leaving our country but Greece has the duty to treat them as human beings!"
The EU statement expressed condolences with Turkey over the deadly Idlib strike and said the bloc was ready to step up humanitarian support.
"The EU is actively engaged to uphold the EU-Turkey (migration pact) and to support Greece and Bulgaria to protect the EU's external borders," said European Council President Charles Michel, who chairs the 27 national leaders of the bloc.
Turkish President Tayyip Erdogan said on Saturday some 18,000 migrants had crossed from Turkey into Europe. Speaking in Istanbul, he did not provide evidence for the number but said it would rise.
Bulgaria said it had seen no migrant inflows.
A Reuters witness said there were about 500 people between the Greek and Turkish border posts, and beyond that on the Turkish side, at the Pazarkule border gate, hundreds more.
Overnight, demonstrators hurled flaming pieces of wood at police, amateur footage filmed by a policeman on the scene, which was seen by Reuters, showed. Police fired teargas to keep people back.
An estimated 3,000 people had gathered on the Turkish side of the border at Kastanies, a Greek government official said. Kastanies is just over 900 km (550 miles) north-east of Athens.
"We are making a titanic effort to keep our borders closed to such migration flows," said Panagiotis Harelas, head of border guards in the area, showing empty tear gas canisters that were hurled from the Turkish side. They had Turkish writing on them.
Nearly 1 million refugees and migrants crossed from Turkey to Greece's islands in 2015, but that route all but closed after the EU-Turkey pact in March 2016.
Greece shares a long river border with Turkey, and is a known route for asylum seekers.
Reuters video showed tens of people at a time climbing, and some throwing their bags over a three-metre (10-foot) fence covered with barbed wire along the Greek border in Turkey's western Edirne province.
A group of Afghans with children waded across fast-moving waters of the Evros river and took refuge in a chapel. They crossed into Greece on Friday morning.
"Today is good," Shir Agha, 30, said in broken English.
Their shoes were caked in mud. Temperatures were close to freezing.
Greece had already said it would tighten border controls to prevent coronavirus reaching its Aegean islands, where thousands of migrants are living in poor conditions.
A Syrian man, who did not give his name, said they had been in the border area for two days.
"We have no food, look at these kids," he said.