Greek police fired tear gas to keep migrants from crossing into Turkey on Saturday after Turkish President Recep Tayyip Erdogan declared his country’s borders with Europe were open.

Erdogan’s declaration marked a dramatic turn from a 2016 deal between Ankara and the European Union that closed Turkey’s borders.

The crush at the border came as fighting intensified in northwestern Syria’s Idlib province, where nearly 950,000 displaced civilians are trapped between advancing Syrian government forces backed by Russia and rebel fighters supported by Turkey.

Erdogan has insisted Turkey can’t handle a new wave of Syrians.

“We will not close the gates to refugees,” he said. “The European Union has 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.”

The Greek government reiterated its promise to keep migrants out.

Greek Prime Minister Kyriakos Mitsotakis tweeted that significant numbers of migrants and refugees had gathered on the Turkish side of the border and no illegal crossings would be tolerated. The tweet, later deleted, also said Greece was not to blame for the “tragic events in Syria.”

Mitsotakis called a meeting of top cabinet and military officials for Saturday.

“The government will do whatever it takes to protect its borders,” spokesman Stelios Petsas told reporters, adding Greek authorities had averted 4,000 attempted crossings in the past 24 hours .

Images broadcast on Greece’s Skai TV showed Greek riot police firing teargas rounds at groups of migrants who were hurling stones and shouting obscenities.

Speaking Saturday in Istanbul, Erdogan said some 18,000 migrants had crossed borders from Turkey into Europe and predicted the number would rise.

Nearly a million refugees and migrants crossed from Turkey to Greece’s islands in 2015, setting off a crisis over immigration in Europe, but that route all but closed after the 2016 agreement.