In a stunning electoral comeback that has surprised everyone, including its own legislators, Turkey's ruling Justice and Development Party (AKP) captured almost 50 percent of the votes, but well over 50 percent of parliamentary seats, in Sunday’s elections. There are many lingering questions. Considering that even the pro-government pollsters did not foresee such a victory, many have asked whether the elections were free and fair. If so, how did the AKP manage to reverse its electoral fortunes in just five months in a country that has been mired in chaos and violence during that time? And finally: what comes next?

There have not been any incidents reported that suggest foul play at the ballot box. But while the elections may have been free, many charge that they were not fair. The AKP mobilized vast state resources to hold pre-election rallies. Meanwhile, the opposition parties had to overcome financial limitations. Although his constitutional mandate prohibited him from taking sides, President Recep Tayyip Erdogan campaigned on behalf of the ruling party. State media provided non-stop coverage for AKP rallies, favoring Erdogan and the ruling party with maximum airtime while opposition parties struggled to get their message across. The AKP’s quasi-monopoly over media outlets silenced most dissenting voices.  As a result, Turkish voters had only limited access to objective information or alternative political views.  

But people still were able to vote freely. So how has the AKP managed to increase its votes by nine percent at a time when the country is mired in a two-front war against the Kurdistan Workers Party (PKK) and the Islamic State (ISIS); when the Turkish lira is depreciating and the economy is teetering on the edge; when institutions are crumbling under an increasingly authoritarian Erdogan; and when societal polarization is at an all-time high? Erdogan’s high-risk strategy of “controlled chaos” seems to have worked.

After the AKP failed to capture a parliamentary majority in the June elections, Erdogan pursued a strategy to appeal to Turkish nationalists and mobilize his party’s own supporters who did not go to the polls in great numbers in June. The strategy seems to have worked. The November elections saw a slight increase in turnout (83.9% vs. 85.2%), while the AKP seems to have won largely at the expense of the MHP (who lost 39 seats and ~2 million votes, i.e., 4.4% of the total). Interestingly, the AKP seemed to have also gained votes from the HDP (who lost 21 seats and ~1 million votes, i.e. 2.4%), since the CHP’s vote share only went up 0.4%. of the total (i.e., 3 seats and ~500,000). Election results indicate that resuming the fight against the PKK convinced the nationalist voters who deserted the AKP in the last elections that the peace process with the Kurds was dead. Additionally, the renewal of conflict also convinced the ruling party’s own supporters that the country would be facing further chaos and instability in the absence of an AKP majority. Erdogan was able to successfully present the ruling party as the only solution to a problem that was mostly of his own making.

In an interesting twist, the AKP seems to have won some of the conservative Kurdish voters it lost to the pro-Kurdish HDP in June. Frustrated with the break-down of the ceasefire between the PKK and the state and disappointed by the HDP’s post-election performance, conservative Kurds seem to have returned to the AKP fold.

Yet the AKP’s win might prove to be a Pyrrhic victory. The ruling party presides over a country in which large portions of the public, particularly the Kurds, distrust the state. The government’s recent military action against the PKK might prove too costly to continue. The AKP can ill afford a war with the Kurds at a time when the Turkish economy desperately needs short-term capital flows. The new government will have to try hard to dispel the image, via a vis international investors, of a country at war.

Erdogan has thrived on polarization. His divisive rhetoric—denigrating AKP opponents as traitors or terrorists and concocting conspiracy theories that portray the ruling party as the target of an international plot—has rallied supporters to the party. These portrayals have pitted the AKP against an opposition that has felt further marginalized and threatened. Polarization is likely to increase after Sunday’s results, making it more difficult for the AKP to govern effectively.

The AKP now faces several questions: How will it choose to manage the explosive political situation? Can it bring together a polarized electorate? Will this weekend’s victory moderate or exacerbate the party’s autocratic streak? Which course will the government take on the Kurdish question and its recent military campaign against the PKK?  What impact will it have on Ankara’s policy toward ISIS? And how will it affect Turkey’s Syria policy, between negotiations in Vienna and backing the armed opposition?

Ironically, Erdogan’s push for a presidential regime can offer a ray of hope on all these questions. After Sunday’s results, Erdogan is poised to revive his presidential dreams. But the AKP still does not have the requisite parliamentary supermajority of two thirds to change the constitution and switch to a presidential system without a referendum. To convince the majority of the electorate to vote for an unpopular presidential system, the ruling party will first have to improve the Turkish economy. Turkish voters have time and time again proven that they prioritize bread and butter over ideology. The party also will have to appeal to a wider constituency, a difficult task in a country polarized by its long-time leader.

So if Erdogan wants to realize his long-held dream, he has to put his political genius to work, this time not to crush opponents and foster polarization but to mend fences and lower societal tension.