ISTANBUL — Voters in Turkey appear to have delivered a resounding rebuke to President Recep Tayyip Erdogan by again electing an opposition candidate for mayor of Istanbul on Sunday, outraged that his party forced the cancellation and redo of the same vote two months ago after it lost.
Within an hour of the polling stations closing, the Turkish news media reported that with more than 60 percent of votes counted, the opposition candidate, Ekrem Imamoglu, was leading with 55 percent, compared with 44 percent for a Mr. Erdogan’s chosen candidate, Binali Yildirim.
Within two hours of the closing of polling, Mr. Yildirim went on national television and appeared to concede.
“As of now, my competitor Imamoglu is leading. I congratulate him, wish him success,” he said. “I wish our friend Ekrem Imamoglu will bring good services to Istanbul.”
The mood was tense in Istanbul during the day as people voted.
“The cancellation of the vote was completely unlawful and illegal,” said Hatice Eksioglu after casting her ballot. “I am certain that he will win, but I am afraid,” she said, referring to Mr. Erdogan.
If the opposition manages to wrest the country’s largest city from Mr. Erdogan’s control, it would be the biggest defeat of his political career, ending his party’s 25-year dominance of the city. Opponents say such a loss would crack the president’s aura of invincibility and could be the beginning of the end of his 16-year rule over the country.
Istanbul is Mr. Erdogan’s home as well as political base, where he began his political career as mayor.
Mr. Imamoglu, 49, is a former district mayor who was backed by an alliance of opposition parties, united by their rejection of Mr. Erdogan’s increasingly authoritarian grip on Turkey.
This election was Mr. Imamoglu’s second victory. He first won the vote on March 31 by a small margin. But Mr. Erdogan’s Justice and Development Party, or A.K.P., contested the results, and the High Election Council ordered the do-over.
Besides the blow to his image and prestige, the loss of Istanbul will have practical political consequences for Mr. Erdogan, analysts said.
“Losing Istanbul would mean losing a significant revenue source for A.K.P.’s political machinery, ranging from subsidies to the party faithful to construction contracts and funds for pro-government media,” Asli Aydintasbas, a senior fellow with the European Council for Foreign Relations, said before the vote.
“It would set off a chain reaction that can herald early elections later this year or in 2020,” she said.
Former President Abdullah Gul and former Prime Minister Ahmet Davutoglu are both committed to breaking away and starting their own conservative movements, Ms. Aydintasbas said.