When they rose to power in 2002, Turkey’s Justice and Development Party (AKP) and its leader, Recep Tayyip Erdogan, made a policy detour from the country’s traditional security concerns. Instead, they sought to make Turkey a proactive player in keeping the region’s power balance stable, pursuing a doctrine of “strategic depth,” based on the concept of “zero problems with neighbors.”

Even though the new approach, referred to as “Strategic Depth,” is the brainchild of Davutoğlu, the concepts on which it is based were not new ideas to many Turkish foreign policy experts. Former Minister of Foreign Affairs, İsmail Cem, had repeatedly stated his belief in the need to improve regional ties, broaden foreign policy interests into far-off regions, and make more effective use of Turkey’s heritage. Cem’s primary motivation, however, was democratic and secular universal principles, not religious sensitivities, though it is easy to distinguish the religious flavor of Davutoğlu’s ideology by reading his book “Strategic Depth.” Those who have read Davutoglu’s book and followed him during the last decade know how strongly his ideology rests on his religious convictions. Although it is understandable that a policymaker’s personal views will influence his policies, it becomes a problem when this influence begins to risk the national security of his country.

For a while, Davutoglu’s approach appeared to be working —until the rapidly shifting political dynamics of the Arab Spring made it untenable. In the past two years, Turkey has sacrificed its traditional role as a secular, democratic and impartial actor in the Middle East, and its relations with nearly every major actor in the region are strained as a result. The AKP’s foreign-policy has squandered Turkey’s political capital to the point where Ankara can no longer act as an effective mediator of regional conflicts and crises. Far from “zero problems,” Turkey finds itself with too many diplomatic crises and national security problems.

In a Foreign Policy article in March, Foreign Minister Ahmet Davutoglu asserted that the “zero problems with neighbors” principle remains alive and well—and more relevant than ever to resolving the challenges facing our region.” Unfortunately, he is fooling himself; Turkey’s current situation proves that the AKP’s foreign policy approach he molded has roundly failed. Just in the past few months, Turkey has lost dozens of its citizens to terrorist attacks and cross-border shelling. Turkish citizens abroad are beginning to be targeted as kidnapping victims by extremists. The country’s military deterrence and its diplomatic leverage with its neighbors have been harmed. These are the unfortunate results of an AKP foreign policy that has positioned Turkey specifically as a Sunni power in a region where sectarian conflict has been intensifying. If Davutoğlu does not accept this reality and rein in his overconfidence, Turkey’s credibility and national security will be under serious threat. Because of Ankara’s negative role in various crises in the Middle East, the victim will be not only Turkey but also the whole region. Turkey will not be able to realize its aspirations to become an honest peace broker in the region.

Take, for example, the latest developments in the decades-long conflict between Israel and the Palestinians. As the two sides finally relaunch peace talks under U.S. auspices, Turkey finds itself completely frozen out of the process. Ankara mishandled its response to provocations such as the 2010 Mavi Marmara incident, when Israeli special forces raided a ship bound from Turkey for the Gaza Strip; Erdogan’s scathing rhetoric prolonged the diplomatic crisis. His unconditional support for Hamas’s rule in Gaza, meanwhile, has hurt Turkey’s standing not only with Israel but also in the West Bank, where Palestinian President Mahmoud Abbas continues to compete with the militant organization for legitimacy among his divided people. In a revealing move, Abbas turned not to Ankara but to the Arab League when searching for an outside authority to provide him the political cover he needed to reengage with the Israelis.

In Syria, meanwhile, the AKP and Davutoglu may see itself as a stabilizing force, but the reality is quite the opposite. The Turkish government’s interference there has exposed the fact that it has abandoned not only its impartiality, but increasingly its secular values as well. In coming to the aid of the Sunni-led rebel Free Syrian Army (FSA), the Erdogan government has thrown its support behind various factions—including Jabhat al-Nusra, a group designated a terrorist organization by the United States and a known associate of al-Qaeda. While opening its borders to Syrian refugees was the right thing to do, Turkey has also provided safe haven to radical Islamist fighters. This has in turn prompted deadly attacks on Turkish soil by supporters of Syrian President Bashar al-Assad, such as the May 11 twin car bombing in Reyhanli that killed more than fifty people. And last year, a Turkish jet fighter was downed by the Syrian air force. This spillover continues to endanger the lives of Turks living near the border, and the nature of Turkey’s involvement deepens and complicates the sectarian divide. In recent weeks, reports from the southeastern town of Ceylanpınar detailed how local authorities have warned residents to stay indoors to avoid stray bullets from clashes between al-Nusra militants and Kurdish fighters across the border in the town of Ras al-Ayn.

Turkey’s decision to throw in with the Syrian rebels has in turn harmed its relations with another neighbor, Iran, which has backed Assad both directly and via its proxy, Hezbollah. As a result, Ankara, once in a position to act as a conduit between Tehran and the West on the topic of Iran’s controversial nuclear program, has been sidelined there as well. Three years ago, Turkey, partnering with Brazil, had the clout to persuade Iran to sign on to a deal seeking to end its standoff with the West. Now, it watches as nearby Kazakhstan prepares to host another round of nuclear talks, and Turkish officials aren't even on the guest list, though the country’s traditional geographic and trade ties to Iran should make it an effective negotiator. Being isolated from the Iranian nuclear talks shows a serious security gap for Turkey’s national security.

In more directly challenging Iran, Turkey has found common cause with the Sunni Gulf block, Saudi Arabia, Qatar, and the United Arab Emirates. However, any advantage there is erased by Erdogan’s stance on Egypt. He was one of the first leaders to call for the ouster of President Hosni Mubarak in 2011, and showered the subsequent Muslim Brotherhood government with $2 billion in investment and aid. But the ouster of Mubarak’s Brotherhood-affiliated successor, Mohamed Morsi, has stymied Turkish diplomats. While the other Gulf states have accepted the situation, Ankara continues to argue in favor of restoring Morsi to power. Defending democratic ideals may be admirable, but Turkey’s hard line is getting in the way of crucial diplomatic and security relations with Cairo. With the Egypt piece, Turkey now has strained relations with all the major actors in the region: Iran, Egypt, and Israel.

With another neighbor, Iraq, Turkey has apparently decided to pursue a divide-and-conquer strategy, directly negotiating oil deals with the autonomous Kurdistan Regional Government (KRG) and sowing deep enmity with Baghdad’s Shia-led government. In hastily consolidating Turkey’s presence in the north, policymakers have potentially put in jeopardy billions of dollars in lucrative deals in the south of Iraq, where the vast majority of the country’s oil lies. Ankara’s bias toward Sunni political factions is evinced by its continued harboring of fugitive former Iraqi vice president Tariq al-Hashimi, and its attempt to defuse its own Kurdish separatist movement by allowing fighters to emigrate to Iraq could have negative repercussions for the KRG and beyond.

Turkey’s actions abroad have not been without ramifications at home. Last month, the Kurdish Democratic Union Party said it would seek independence for Kurdish-controlled enclaves in Syria, complicating not only Ankara’s Syria policy but its domestic policy towards Turkish Kurds as well. Now, Turkey faces a dilemma in northern Syria between the jihadists it supported and lobbied for in Washington, and the Kurdistan Worker`s Party (PKK). Turkish activities domestically as well as in Syria and Iraq expose a huge contradiction in the position of the Erdogan government on the issue of Kurdish independence. By continuing to negotiate energy deals directly with the KRG, Ankara implicitly accepts a self-governing Kurdish presence on its border in Iraq—but incoherently, it refuses to accept that as a possibility in northern Syria. Meanwhile, within its own borders, the government continues to engage in peace talks with the leaders of the PKK—talks on which Turkish foreign policy cannot help but have an effect.

In the past, Turkey was able to play the role of regional mediator because it was seen as a fair and impartial actor. Those days are gone. After the Gezi protests, and the subsequent erosion of public trust in the domestic political system, Turkey is far from being a democratic and secular model in the region. If the AKP wants even a chance at regaining that status, it must stop playing sectarian favorites and return to Turkey’s traditional commitment to democracy and secularism. Only then will Ankara’s actions truly reflect its ambitions of being a stabilizing force in the Middle East, instead of contributing to regional chaos. If the Turkish government really still wants “zero problems” with its neighbors, it should start acting like it. This does not necessarily mean giving up on a more proactive approach in foreign policy. It means assuming a positive and constructive role in its foreign policy.

The AKP’s sectarianism will lead Turkey in the wrong direction as a regional player. The country’s tradition of secular democracy would be a better example for the troubled Middle East. Turkey, long a bridge between the West and the Middle East, can still be this bridge—but not if it is playing favorites and helping to widen divides in countries torn by the conflicts of the Arab Spring.

Cenk Sidar is the managing director of Sidar Global Advisors in Washington DC. Email: cenk@sidarglobal.com