Sunday’s parliamentary elections in Turkey yielded a resounding vote of no confidence in President Recep Tayyip Erdogan’s increasingly authoritarian and pro-Islamist policies.

Erdogan’s political party, the Justice and Development Party (AKP is the Turkish acronym), which has dominated Turkish politics since 2002, suffered a decisive setback, garnering less than 41 percent of the vote. According to the early results, the AKP won roughly 258 seats, 18 short of the 276-seat majority needed to form a single-party government in the 550-seat Grand National Assembly.

The AKP was hobbled by a sluggish economy, rising unemployment, corruption scandals and a growing popular backlash against Erdogan’s increasingly despotic leadership. The headstrong and thin-skinned Erdogan had sought to cement his personal control over state institutions, including the army and judiciary, while cracking down on the press and social media, if they became too critical.

The election results pose a major check on Erdogan’s ambitions to recast Turkey’s parliamentary system by endowing his office of the presidency with much greater powers. He needs 330 votes, (two-thirds of parliamentary votes) to push a new constitution through the Grand National Assembly and put it to a referendum.

The election rebuke has been described as “a nuclear explosion in Turkish politics” that may loosen the AKP’s grip on power. Although it remains the largest political party, the AKP now needs to form a coalition with at least one other political party or risk forming a minority government that could quickly be voted out of power.

The big winner in the elections was the People’s Democratic Party (HDP), a predominantly Kurdish liberal/leftist party which crossed the 10 percent threshold to gain a presence in parliament for the first time. The HDP provisionally won 79 parliamentary seats when many Kurds in Turkey’s big cities who formerly voted for AKP switched their support to the HDP.

The secularist, social democratic Republican People’s Party (CHP), the biggest opposition group, gained 132 seats. The Nationalist Action Party (MHP), a conservative nationalist opposition group, won 81 seats.

Both of those political parties have ruled out forming a coalition with the AKP. But it is difficult to imagine them putting aside their deep differences to join with the HDP to form a stable ruling coalition.

It is more likely that the AKP will form a minority government or strike a deal with one of the other factions to form a ruling coalition. Such a government is unlikely to last long and new elections could be called for soon.

But the bottom line is that Turkish voters have dealt a stinging rebuke to President Erdogan’s plans to consolidate his control over Turkey’s governing institutions. That outcome is a victory for Turkish democracy.