This publication is from Carnegie’s Rising Democracies Network.

Turkey’s drift back into authoritarianism has international implications. After losing its parliamentary majority last June, the country’s Justice and Development Party (AKP) recovered ground to win just under 50 percent of the vote in November’s repeat election. This support was enough to enable the AKP to form a single-party government. This turn-around has not only damaged Turkey’s own democracy, but has also caused it to drift away from the pro-democratic foreign policy that it had begun to develop in the mid-2000s. Today, the government’s foreign policy is increasingly based on support for its Sunni allies — and this sectarian logic now taints and distorts Turkey’s support for democratic norms across the Middle East.

In the early 2000s, many Arab reformers saw Turkey as a beacon of democracy in their region. In those years, Turkey focused on democracy promotion at two levels — positioning itself as a model of democracy in its neighborhood while also funding democracy assistance projects and supporting pro-democratic movements in other countries. Both of these approaches have lost traction.

Today, Turkey hardly stands as a positive example for democratic reformers in the Middle East. The AKP’s democratic reforms in the early 2000s attracted much international praise and some emulation. But the democratic reform process stopped around 2005 and went into reverse following the AKP’s third electoral victory in 2011. Today, the AKP seems intent on pushing for a hyper-presidential system of government. This is widening Turkey’s social polarization and eroding the country’s already weak system of checks and balances. Violence in the southeast of the country continues to escalate, with decreasing prospects of a revitalized peace process. The EU is increasingly turning a blind eye to Turkey’s democratic regression in return for cooperation on controlling the flow of Syrian refugees and other migrants entering Europe.

Turkey’s support for pro-democracy movements in its wider neighborhood has also plateaued. The volume and scope of Turkish democracy assistance rapidly expanded in the early 2000s. In 2013, Ankara provided $3.8 billion worth of aid to 121 countries across the globe, which included numerous projects to foster democratic and governance-related reform. This increase was driven in part by the AKP government’s ambition to spread Turkey’s soft power throughout the post-Ottoman space. But today, Turkey’s commitment to democracy aid is increasingly clouded by sectarian interest.

In 2011, Turkey aligned itself with the popular revolts of the Arab spring. It provided substantial amounts of international aid to the affected countries, and much of this money was earmarked for democracy assistance. The AKP’s pro-democracy commitment was particularly strong in the case of Egypt, where the Muslim Brotherhood’s rise to power after the 2011 revolution promised to benefit the AKP. As a result, Ankara committed to providing development aid worth $2 billion to Egypt in 2012.

The June 2013 coup in Egypt changed this scenario. With the ouster of President Morsi, the AKP lost a Sunni Islamist ally and suffered a foreign policy defeat. The AKP government began using the democracy narrative in a more directly instrumental fashion as a tool for discrediting the opposition within Turkey. The government labeled those within Turkey who had criticized Morsi’s own record on democracy as undemocratic supporters of the coup.

The pro-democracy rhetoric in Turkish foreign policy lost further credibility as the Syrian civil war unfolded. The Turkish government’s uncompromising criticism of the Alawite regime of Syrian President Bashar al-Assad has given rise to the perception that it is adopting a strongly sectarian, pro-Sunni stance. This has engendered doubts about the impartiality of Turkey’s discourse on democracy in the region. While Turkey was initially careful not to project the image of being a sectarian actor, the government has increasingly abandoned this caution as Assad has continued to cling to power. The AKP has also used anti-Shia discourse to discredit domestic opposition within Turkey itself. It has provided active support to Sunni rebel groups in Syria, followed assertively pro-Sunni policies from Iraq to Yemen, and fostered closer relations with regional Sunni states, such as Qatar and Saudi Arabia.Turkey’s pro-democracy policy has turned into a pro-Sunni policy.

The downing of a Russian plane in Turkish airspace in November 2015 and the following tensions with Russia show how a rigid and largely sectarian foreign policy in Syria has brought Turkey into confrontation with one of its key partners. This has weakened the already fragile anti-Islamic State coalition that emerged after the terrorist attacks in Paris attacks and boosted Russian claims that Turkey maintains close relations with Sunni Islamist fundamentalist groups in Syria. The AKP government seems to have only recently grasped the severity of the danger that the Islamic State poses for both Turkish and global security. Against this backdrop, Turkey’s role as a “rising democracy” committed to supporting democratic reform both domestically and internationally looks increasingly questionable.

Such a role — which showed some promise in the early days of the Arab Spring — is now undercut by the AKP’s undemocratic performance at home and by regional security rivalries. The negative trends run in both directions. Regional geopolitics is fuelling authoritarianism within Turkey, and the latter in turn weakens Turkey’s democratic legitimacy among reformers across the Middle East. The relationship between the foreign and the domestic is becoming ever more problematic in Turkey, creating a vicious circle that, thus far, shows no signs of ending.

This article originally appeared in Foreign Policy.