– Turkey, which for eight years has welcomed millions of Syrian refugees, has reversed course, forcing thousands to leave its major cities in recent weeks and ferrying many of them to its border with Syria in white buses and police vans.

President Recep Tayyip Erdogan is pushing a radical solution — resettling refugees in a swath of Syrian territory controlled by the United States and its Kurdish allies. If that does not happen, he is threatening to send a flood of Syrian migrants to Europe.

Erdogan has long demanded a buffer zone along Turkey’s border with Syria to keep out Kurdish forces, whom he considers a security threat.

But he has repackaged the idea for the zone as a refuge for Syrians fleeing the war — pushing it as resentment against Syrians in Turkey has increased, and a Syrian and Russian offensive in Syria has sent hundreds of thousands more refugees fleeing toward the Turkish border.

“Our goal is to settle at least 1 million Syrian brothers and sisters in our country in this safe zone,” Erdogan told leaders of his Justice and Development Party in Ankara on Thursday. “If needed, with support from our friends, we can build new cities there and make it habitable for our Syrian siblings.”

None of the other powers involved in the war in Syria has wholly agreed to the idea, but Erdogan is demanding immediate access to the territory or threatening to take it himself. If not, he said, he would “open the gates” for large numbers of refugees to head into Europe as they did in 2015.

The European Union has given Turkey about $6.7 billion since 2015 to help control the flow of migrants. But Turkey, which has given sanctuary to 3.6 million Syrians, says the migrant problem is growing exponentially.

“If there is no safe zone, we can’t overcome this,” Erdogan said on Saturday.

Erdogan was long seen as a champion for Syrian refugees. His tougher policy on them comes after his party suffered a humiliating defeat in the election for mayor of Istanbul in June, and as a deepening recession, soaring unemployment and inflation have stoked anti-Syrian feeling among Turks.

Officials are cracking down on Syrians working illegally or without residence papers, fining employers and forcing factories and workshops to close. Pro-government media have grown more critical of Syrians, landlords are raising their rents, and social media is bursting with anti-Syrian comments.

Local officials, many from Erdogan’s party, deny the government is deporting refugees but support the crackdown, saying Syrians must live within the law.

The change is evident in places like Esenyurt, a working-class district of Istanbul. A district spokesman, Fatih Yilmaz, said the municipality was providing buses for around 100 people a week to return to Syria. He said the departures had pleased Turkish citizens, even if factory owners complained they had lost workers and landlords had lost tenants.

For Syrians living in Turkey, the shift in policy and attitude is a painful shock.

Police officers in Gaziantep visited a street of Syrian grocery and pastry shops and told store owners to remove the Arabic lettering from their shop signs or face a fine, enforcing a local law that had been ignored for eight years.

Mohammad al-Azouar, whose family operated a well-known pastry shop in Aleppo, Syria, dutifully covered up a verse by poet Rumi on the wall inside his shop.

“One fine from the police would finish me,” he said. “I am no burden. I came with my own money, just don’t squeeze us by the neck, let us survive.”