Following the March 30 local elections, which Prime Minister Recep Tayyip Erdogan had turned into an informal referendum on his own polarizing policies, Turkey is facing uncertainty both at home and abroad. Erdogan’s moderate Islamist Justice and Development Party (AKP) won the elections decisively, gathering some 45 percent of the vote and besting its result in the previous local elections in 2009 (its main rival, the Republican People’s Party, or CHP, came second with some 28 percent). But the next big election is already in sight – on August 10 Turks will vote in the first direct presidential vote in the country – and Turkish society is deeply divided. There is also trouble brewing with the economy and with Western allies who are uncomfortable with Erdogan’s continued crackdown on the separation of powers and on civil liberties in the country.

One of the biggest uncertainties ahead is whether Erdogan, who is prohibited from running for a fourth term as a prime minister by internal party rules, will run for president instead. An AKP convention last week voted to support him as their preferred candidate, yet the president in Turkey lacks significant executive powers and Erdogan has been lukewarm to this option in his official statements (he could instead try to change the AKP regulations and run for a prime minister anyway). Besides, the current president Abdullah Gul is also a leading AKP figure who has ruled out a potential “Putin-Medvedev”-style swap, and the possibility that the two might run against each other is unnerving to many AKP members and voters.

Even if Erdogan were to find an elegant solution to this dilemma, the task of leading his party to victory in the presidential elections would likely prove a difficult one. Though the opposition is divided on most other issues, many of the 55 percent of citizens who voted for other parties in the local elections are united against him and could be expected to vote against the AKP candidate in a widely expected run-off in the presidential vote. His main strategy has been to attract Kurdish voters with his professed desire to end the decades-long conflict in southeastern Turkey—yet the peace process, too, has stagnated and it is uncertain how many Kurds would actually vote for the AKP.

While Erdogan’s supporters have consolidated behind him, his enemies are multiplying as his crackdown on dissent intensifies. In response to a major graft probe against his allies launched in December 2013, his government unleashed purges on the police and the judiciary and blocked access to the social media sites Twitter and YouTube, where leaks were published anonymously. After the constitutional court overturned the Twitter ban, Erdogan became the first prime minister in Turkey’s history to sue the state for damages. The constitutional court recently overturned a law designed to tighten the government’s control over the independent judiciary, and several other bills that recently passed parliament, including one to expand the prerogatives of Turkey’s main intelligence agency, are threatened by a similar fate. At the same time, protests and confrontations with the police continue in the streets of Istanbul and other major cities and critics worry that violent confrontations between government supporters and opponents could escalate.

To make matters worse, the Turkish economy, widely viewed as one of the “Fragile Five” in the world, is facing significant challenges. While unemployment has fallen slightly over the last year, so too has the value of the Turkish currency—and foreign investors have been spooked by the growing instability in the country. Recent data published by the daily Hurriyet shows that capital inflow has shrunk significantly in the period from December 2013 to March 2014, with only $3.1 billion coming in through official channels to balance a deficit of $16.5 billion. Credit agencies such as Moody’s have lowered Turkey’s outlook, and analysts speculate that Erdogan may choose to pull general elections forward, currently scheduled for next year, if the threat to Turkish economic stability continues to grow.

Turkey also faces a crisis with its neighbors as well as with its main allies abroad. Erdogan’s attempts to stifle domestic dissent and to blame various Western-sponsored “lobbies” for his problems have run afoul of the European Union and the United States, while his failed attempts to bring down the Syrian regime and to prop up the Egyptian Muslim Brotherhood have isolated him in the Middle East. His government’s trademark policy of “zero problems with neighbors” from a few years ago has mostly run aground.

While Erdogan remains Turkey’s most popular and successful politician since the secular republic’s founder Mustafa Kemal Ataturk, his government faces unprecedented challenges in 2014. How he will handle these challenges will determine his political future as well as that of his country—and will influence that of the entire region.