Ahmet Davutoglu, left, with Turkish president Recep Tayyip Erdogan | Aris Messinis/AFP via Getty Images Opinion Turkey power shift upends EU refugee deal The sudden transition will pose a significant challenge to the country’s relations with Europe.

ISTANBUL — The growing power struggle between Turkey’s Prime Minister Ahmet Davutoğlu and President Recep Tayyip Erdoğan reached its inevitable conclusion Thursday with Erdoğan forcing Davutoğlu's resignation. The ruling AK Party will now hold an extraordinary convention May 22 to elect its new leader and the country’s chief executive office holder. As the outgoing prime minister, Davutoğlu confirmed that he would not stand for nomination.

Yet as smooth as it may appear on the surface, this sudden transition is set to have a significant impact on the country’s relations with Europe and the fate of the refugee deal.

The change in the power constellation in Turkey comes at a most inopportune time. Just a day earlier, the European Commission conditionally recommended to proceed with visa freedom with Turkey. Having very much commended Ankara’s recent efforts to comply with the 72 technical criteria set out as conditions for the lifting of visas, the Commission nonetheless stated that Turkey would still need to fulfill five of them to achieve this objective.

Of key importance is the criteria that requires Turkey to change its anti-terror legislation in line with the European acquis and the jurisprudence of the European Court of Human Rights. Turkey would also need to ensure that its courts interpret the law and its law enforcement apply the legislation in accordance with European norms and practices. As a country that is under a palpable threat of terrorism as a result of the PKK’s armed campaign and the Islamic State’s suicide attacks, Turkey has been unable and unwilling to fulfill this condition.

* * *

But with the power shift in Ankara, it has become even more difficult for Turkey to comply with such a requirement. Compared to Davutoğlu, Erdoğan has been much more categorical and hawkish regarding the implementation of the anti-terror legislation. The difference of opinion emerged very clearly with a recent case against academics who had signed a peace petition to end the violence in Turkey's southeast. Many of the petitioners were prosecuted, some even incarcerated for allegedly backing the PKK, a Kurdish terrorist entity according to Ankara.

Erdoğan strongly backed these proceedings while calling for the anti-terror law to be broadened in scope and amended to include academics, writers and journalists that could be charged with abetting terrorism. So it is increasingly unlikely that with Erdoğan's move to replace the AKP leadership and his unassailable influence over the ruling party, Turkey will be in a position to change its anti-terror legislation as stipulated by the European Commission.

Another key request from the Commission relates to the recently adopted legislation on data privacy where Brussels demands more independence for the Data Protection Authority but also more restraint for government agencies in terms of access to personal data on grounds of public order and national security. This will require the establishment of new norms of democratic transparency and accountability for the workings of the security and intelligence agencies, yet another politically-challenging task for Turkish authorities.

At the same time, the Commission’s margin of maneuver seems limited by the ongoing negotiations with the U.S. on cross border data flows where Brussels is intent on getting additional assurances from Washington for the protection of personal data.

Turkey will now launch a diplomatic initiative to gauge whether European institutions can demonstrate a degree of flexibility regarding the residual conditions. But the initial signs are not particularly positive with the president of the European Parliament stating unequivocally that Commission recommendation to lift visas will not be forwarded to the relevant Parliamentary committee for deliberation until Turkey fulfills all the remaining conditions.

* * *

So just within hours of the Commission's recommendation, the roadmap for visa liberalization and by extension the refugee deal seems to be upended.

Ankara stated clearly that it would suspend the Turkey-EU Readmission Agreement unless it receives visa freedom from Europe, potentially leading to the collapse of the whole refugee deal. So instead of a happy ending, the prospect of which had been briefly ushered in by the Commission recommendation, the more likely scenario now is one of a bitter divorce.

The consequences will be significant not only for Ankara’s relations with Europe but also for many European countries that will start to face growing number of illegal migrants on their shores.

Sinan Ülgen is a former Turkish diplomat, the executive chairman of the Istanbul based EDAM think tank and a visiting scholar at Carnegie Europe in Brussels.