Recep Tayyip Erdogan should have seen it coming. Perhaps he did, given that opinion polls were reasonably accurate in predicting the result of Sunday’s parliamentary election in Turkey. In which case, his tactics clearly backfired.

Erdogan wasn’t a candidate, having last year successfully engineered his elevation to the presidency, constitutionally a relatively symbolic post. No one was particularly surprised when the focal center of political power consequently shifted from the head of government to the head of state.

That wasn’t enough for Erdogan, though. He sought a constitutional shift from a parliamentary to a presidential form of government. A two-thirds majority for his Justice and Development Party (AK party) in Sunday’s election would have made this a cinch. Even a three-fifths majority would have sufficed to facilitate a plebiscite.

Instead, for the first time since 2002, the AK party garnered substantially less than 50 percent of the vote, compelling it to form a coalition. Its likeliest partner in this enterprise is the Nationalist Movement Party (MHP), a right-wing outfit that secured about 17 percent of the vote.

The MHP has thus far been reluctant to commit itself in this respect, while AK party representatives have raised the prospect of a second election, should a coalition prove unachievable.

The latter option may not turn out to be a particularly desirable alternative for the AK party. It is, after all, not inconceivable that, in the event, it could end up with a share of the vote even smaller than the disappointing 41 percent it has achieved this time.

This is, mind you, a figure that would be coveted by ruling parties in many other countries. Turkey, to its credit, operates on the basis of proportional representation. At the same time, based on rules introduced by a military dictatorship, the threshold for entry into parliament is set at an uncommonly high 10 percent of the popular vote.

That is why it was something of a gamble for the People’s Democratic Party (HDP) to put up candidates. Had it failed to scale the 10 percent hurdle, it votes would have been redistributed, going mainly to the AK party. That is why candidates associated with its left-liberal and pro-Kurdish line of thinking previously contested as independents, who are exempted from the 10 percent rule.

They won some representation in parliament, but were unable to act as a coherent bloc. With the HDP’s nearly 13 percent of the vote, their parliamentary numbers have been doubled to 80 seats, despite (or perhaps because of) Erdogan’s unrelenting efforts to dismiss the party as a bunch of degenerates. There is some evidence, though, that in appealing to his conservative base, Erdogan lost the support of those who appreciate his achievements but were disinclined to give him a carte blanche.

The mood is clearly not unconnected to the Gezi Park protests of 2013 and the government’s crude reaction to them. It also bears some relation to Erdogan’s reaction to the so-called Arab Spring, whereupon he donned the mantle of a putative leader. Many Turks have also been disturbed by Erdogan’s attitude toward the conflict in neighboring Syria, with Turkey serving as the commonest conduit for deluded international recruits eager to lend their services to Daesh or Jabhat Al-Nusrah. Erdogan has been inclined to see the regime of Bashar Assad as the biggest threat, despite having once designated him as a brother, and has therefore tended to view the Islamist outfits as potential allies.

Much to the consternation of Turkish Kurds, he resisted allowing their fighters to go to the aid of the besieged Syrian town of Kobane, and AK party representatives have on occasion lauded Daesh’s initiatives. Despite negotiations for a settlement with the Kurdistan Workers’ Party (PKK), the HDP has been pilloried as an associate of the PKK.

In fact, the HDP came fourth in Sunday’s election by broadening its appeal beyond Kurds to socially liberal Turks, and by being remarkably inclusive in its outreach. Its leader, Selahattin Demirtas, has been compared with Barack Obama, but in fact bears a closer resemblance in many ways to Greece’s Prime Minister Alexis Tsipras.

It is not inconceivable that a second election this year could give Demirtas a more substantial mandate. But Turkey’s future is hazy. This week’s election has been variously described as a watershed and the beginning of the end of Erdogan. It may well turn out eventually to conform to those optimistic prognostications. But it’s too soon to say.