For Mr. Erdogan, the smoldering violence represents his worst political crisis since coming to power a decade ago. It also highlights the kind of class politics that have divided society, with his conservative religious followers strongly supporting his position. But his political base — a majority — has not protected the economy, which is suffering as the currency loses value and the cost of borrowing rises.

Analysts now worry that Mr. Erdogan, instead of finding a way out of the crisis, has only made it worse by hardening divisions among his constituents, and by digging in. Three people have been killed and at least 4,947 injured in the violence.

“The leaders may be searching for a way out of the deadlock,” wrote Melih Asik, a columnist in Milliyet, a centrist newspaper. “However, has inciting one half of the people against the other half ever been a remedy for overcoming such a crisis? If limitless anger does not give way to common sense, Turkey will have a very difficult job ahead.”

Mr. Erdogan, in rally after rally over the weekend, sought to energize the conservative masses who propelled him to power by invoking his personal history as an Islamist leader opposed to the old secular state and its undemocratic nature. His supporters represent a social class that was previously marginalized, and Mr. Erdogan has used his speeches to play on those class resentments.

“The potato-head bloke, itching his belly — this was how they regarded us for decades,” he said in a speech on Tuesday. “They think we do not know anything about politics, arts, theater, cinema, poetry, paintings, aesthetics, architecture.”