European Commission President Jean-Claude Juncker attends a debate on the preparation for the upcomming European Council summit of E.U. leaders, at the European Parliament during in Strasbourg, France, October 5, 2016. REUTERS/Vincent Kessler

BRUSSELS (Reuters) - European Commission President Jean-Claude Juncker dismissed Turkey’s threats to walk away from a promise to stem the flow of illegal migrants to Europe if the European Union fails to grant Turks visa-free travel to the bloc.

Turkish leaders would be to blame if the deal collapses, Juncker said in an interview published on Saturday, in which he warned that Turkey was drifting away from democratic values and closer ties with Europe.

“I am immune to threats from Turkey’s leaders,” Juncker told Belgian newspaper Le Soir. “If Turkey does not fulfil the conditions laid down, there will be no progress on visas,” he said, adding that if the deal collapses “it will be Turkey’s fault.”

Turkey agreed in March to stop illegal migrants from crossing into Greece in exchange for financial aid for those in its care, the promise of visa-free travel for its citizens to much of the EU, and accelerated EU membership talks.

But there has been deadlock over the plan to grant Turks visa-free access to Europe, with Brussels first wanting Turkey to change its anti-terrorism laws, which it deems too broad.

European leaders also criticized Turkey’s detention of leaders of the country’s main pro-Kurdish opposition party in an investigation on Friday.

While Juncker did not comment directly on the arrests, the head of the EU executive called the reaction of the government to a failed coup attempt in Turkey on July 15 “excessive”.

“I note with sadness that Turkey is moving away from Europe; it is not Europe that is moving away from Turkey,” Juncker said.