ANKARA, Turkey (AP) — In a stunning rebuke of President Recep Tayyip Erdogan’s ambitions to expand his powers, Turkish voters stripped his party of its simple majority in parliament, preliminary election results showed Sunday.

With 99.9 percent of the vote counted, Erdogan’s ruling Justice and Development Party, the AKP, had the support of around 41% of voters, state-run TRT television said. According to projections, that would give it some 258 seats — 18 below the minimum needed to keep its majority.

The unexpected setback for AKP likely puts an end, for the time being, to Erdogan’s hopes of passing constitutional changes that would have greatly boosted the powers of his office. Instead, he faces struggles to retain his pre-eminent place in Turkish politics without the obvious levers to steer the government through his party in parliament.

Get The Times of Israel's Daily Edition by email and never miss our top stories Free Sign Up

The result is also a bitter blow to Prime Minister Ahmet Davutoglu, whose political prospects are uncertain after leading his party to such a disappointing result. AKP will now have to seek a coalition partner to stay in power, with the nationalist MHP the most likely candidate.

Late Sunday, Davutoglu declared victory in the election, but didn’t acknowledge his party had lost its majority.

“Everyone should see that the AKP was the victorious party and the winner of this election. There is no doubt about that,” he said. “We will assess the messages of this election and continue on our path in a more determined way.”

In an indication of how precipitously Erdogan’s fortunes have fallen, he had begun the campaign asking voters for 400 of the total 550 seats in the Grand National Assembly, a massive majority well above the 330 seats needed to call for a national referendum to change the constitution.

The biggest setback for AKP came with the rise of the main pro-Kurdish party, HDP, which for the first time easily cleared the threshold of 10% for representation as a party in the parliament. The preliminary results put its tally at almost 13%.

The main secular opposition Republican Peoples Party, or CHP, got about 25% of the vote, while MHP got just above 16%.

AKP received around 49% of the vote in the general elections in 2011. The setback Sunday was the first time that the party faced having to find a coalition partner since it swept into power in 2002.

Erdogan himself was not on the ballot. Still, the election was effectively a vote on whether to endow his office with powers that would significantly change Turkey’s democracy and prolong his reign as the country’s most powerful politician.

“Erdogan turned the election into a referendum on his personal ambitions,” said Fadi Hakura, a Turkey specialist at London-based Chatham House. “These elections have put his plans on the back burner for a very long time.”

The party appeared to suffer from a sputtering economy and frustrations with the peace process to end decades of fighting with Kurdish insurgents.

HDP’s apparent leap above the 10% threshold would vault it into a significant position in parliament.

It seemed to have made considerable gains in southeast Turkey, suggesting that religious Kurds had turned away from AKP in favor of HDP. AKP also appeared to have lost votes in Sanliurfa and Gaziantep where there are large numbers of Syrian refugees.

The vote came amid high tensions after bombings Friday during a HDP rally killed 2 people and wounded scores. On Sunday, Davutoglu said a suspect had been detained in the case, but provided no other details.

HDP leader Selahattin Demirtas called his party’s ability to cross the threshold a “fabulous victory for peace and freedoms” that came despite the attack on his party and fierce campaigning by Erdogan.

“As of now the discussions on a presidential system, a dictatorship has come to an end,” he said.

Erdogan has been Turkey’s dominant politician since his party swept into power in 2002 — becoming prime minister in 2003 and leading his party to two overwhelming parliamentary election victories. In a gamble last year, he decided to run for president, banking that his party could later bolster his powers.

Under the current constitution, Erdogan is meant to stay above the political fray as president. But he campaigned vociferously, drawing complaints from the opposition that he ignored the constitution.

“The true loser of this election is Erdogan,” said Haluk Koc, a deputy leader of the main opposition CHP party. “Turkey won.”

As he cast his vote Sunday, Erdogan praised the election as an indication of the strength of democracy in Turkey.

“This strong democracy will be confirmed with the will of our people and extend the trust we have in our future,” Erdogan said.

After the final official results are confirmed there is a 45-day period in which a new government needs to be formed, or new elections are called.

Copyright 2015 The Associated Press.