ISTANBUL — Turkey’s main opposition party appeared poised to win mayoral races in Ankara, the capital, and several other cities in local elections on Sunday, dealing a significant setback to President Recep Tayyip Erdogan after he campaigned relentlessly for his party’s candidates but faced a voter backlash over his management of the economy.
Erdogan’s ruling party claimed victory Sunday in Istanbul, Turkey’s largest city, even as official tallies showed a razor-thin margin in the contest. (Later on Sunday, though, Erdogan appeared to suggest that his party may have lost Istanbul’s mayoral race.) Kemal Kilicdaroglu, the head of the main opposition Republican People’s Party, said its candidate was ahead as he urged supporters to stay at the polls.
Erdogan, speaking to reporters on Sunday night, said his Justice and Development Party and an allied party had captured the majority of votes in the nationwide contest — a continuation, he said, of his party’s electoral dominance since 2002. At the same time, he appeared to acknowledge the symbolic weight of the losses in Ankara and other cities.
“We will accept that we were not successful in the places that we lost,” he said.
Later, speaking in Ankara, he said, “Tomorrow morning, we will start our work to detect our shortcomings.”
The election for mayors, municipal council members and other local posts represented the first nationwide referendum on Erdogan’s leadership since he won a presidential poll in June. Since then, Turkey’s economy has slipped into a recession for the first time in a decade, forcing the government to defend policies that have unnerved investors and sent prices soaring.
A crackdown on the government’s opponents that intensified after a failed coup in 2016 has added to the domestic unease and has also troubled Turkey’s relationships with Western allies, causing sharp fluctuations in the Turkish lira and putting investors on edge.
Erdogan’s own position was secure. Even so, he raced around the country in recent weeks, attending campaign rallies at a punishing clip that he referred to Sunday as a “marathon.” His bellicose rhetoric — red-meat appeals to his conservative Muslim base and menacing language leveled at his opponents, some of whom he labeled “terrorists” — underscored the stakes in the election.
“It is a matter of survival,” Erdogan said of the poll, at a rally in a working-class district of Istanbul on Friday.
But even as the president framed the elections in terms of national security, many voters “did not buy it,” said Murat Yetkin, a Turkish political analyst and author of a blog called the Yetkin Report. “The pollsters were telling us that 80 percent were seeing the economy — namely the cost of living and unemployment — as the biggest problem,” he said.
“This is a major loss. If the toll includes Istanbul, finally — five big cities of Turkey, including Ankara — some 40 percent of the population” would be under opposition control, potentially creating governing problems for Erdogan, he said.
The Turkish elections at one point threatened to become an international diplomatic crisis, when Erdogan was criticized by officials in New Zealand for repeatedly airing footage at his rallies of the mosque shootings in the city of Christchurch that killed 50 people in March.
The Trump administration was closely watching the ballot and hoping that a catalogue of disputes with Ankara — including arguments over the war in Syria and Turkey’s purchase of a Russian air defense system — would quiet once Turkey’s caustic campaign season had come to an end.