The EU’s deal on migrants and refugees with Turkey is on the verge of collapse as each side is holding firm on its view of Ankara’s anti-terrorism legislation.

Under the deal, which went into effect in March, the EU would send those migrants and refugees who illegally entered the bloc to Turkey in exchange for an equal number of registered Syrian refugees. In return, among other things, the EU agreed to visa-free travel for Turks in the Schengen zone provided Ankara satisfied 72 conditions. One of those conditions was altering Turkey’s anti-terrorism legislation, which the EU worries could be used to target dissidents as well as journalists. Turkey had, in principle, agreed to tweak the legislation, but Ahmet Davutoglu, the Turkish prime minister who was one of the architects of the agreement with the EU, stepped down earlier this month following a power struggle with Recep Tayyip Erdogan, the country’s president. Erdogan has refused to change the law, saying it would embolden terrorists, including ISIS and Kurdish separatists. “We are going our way,” he said last week to the EU, “and you can go yours.”

On Thursday in Ankara, Erdogan said the EU was moving the goal posts.

“Either we will improve our relations with the EU, or we will set a new path for ourselves,” he said. “We prefer to build the new Turkey with our EU friends, but now we will wait for the decision of our EU friends.”

In Berlin, Jean-Claude Juncker, the European Commission’s president, responded: “We put great value in the conditions being met. Otherwise this deal, the agreement between the EU and Turkey, won't happen. If Mr Erdogan decides to deny Turks the right to free travel to Europe, then he must explain this to the Turkish people. It will not be my problem, it will be his problem.”

The German government, which worked with Turkey closely on the migrant deal, also stood with the EU. Frank-Walter Steinmeier, the foreign minister, said: “The ball is in Turkey’s court.”

The collapse of the agreement has implications far beyond visa-free travel for Turks. The deal was struck in the first place because of Europe’s inability to deal with the massive flow of migrants and refugees from Syria and elsewhere. Presumably, that flow of migrants to the EU will pick up once more. Additionally, Turkey has long aspired to join the EU; the death of the deal could have consequences for those aspirations, as well.

We want to hear what you think about this article. Submit a letter to the editor or write to letters@theatlantic.com.