ISTANBUL — It was bad enough for President Recep Tayyip Erdogan of Turkey that his chosen candidate lost again in a do-over election for mayor of Istanbul. But as the scale of the defeat became clear on Monday, Mr. Erdogan and his strongman methods faced recriminations not just from critics, but from his party and wider circle of supporters.

Not only did more people vote in the repeat election on Sunday, but they gave the opposition candidate the kind of endorsement that indicated a desertion from the governing Justice and Development Party, the A.K.P., and even from Mr. Erdogan himself.

The result fractured the invincibility of a strong-willed leader with little tolerance for dissent, who has made Turkey an increasingly prominent force in the Middle East and raised tensions with the United States as he moves his country, a member of NATO, closer to Russia.

“Earthquake at the ballot box,” ran the front-page headline of Karar, a newspaper founded three years ago by journalists who had once been close to the A.K.P. government.