Turkish President Recep Tayyip Erdoğan's party lost Istanbul's mayoralty on Sunday for the second time this year. The first time, Erdoğan demanded a recount, lost it, then refused to accept the result, and had a kangaroo court throw it out.

Now Erdoğan has lost again. Think of this as his Titanic moment: His political hull is breached, his ship is taking on water, and there's an increasingly strong likelihood that he won't survive another election.

The Justice and Development Party's repeat loss of control over Turkey's financial and symbolic capital is a huge blow. In that loss, Erdoğan shows vulnerability to that which he despises: democratic accountability. Because this defeat was a defining victory for democracy. It is made worse by the fact that this was an Erdoğan-connived rerun of the March election that he had already lost. Furious at losing control over his hometown fiefdom, Erdoğan ordered a recount of the March results. When that failed to alter the outcome, he pressured the electoral court into holding this rerun. Residents of Istanbul didn't like it. From a very narrow win in March, the Kemalist-opposition Republican People's Party, or CHP, candidate Ekrem Imamoglu on Sunday widened his margin of victory by nearly 9 percentage points. This time, there won't be a recount.

Thus, what was at first Erdoğan's embarrassing rebuke is now a disaster. The once all-powerful master of destiny has had his political identity punctured in his own hometown. Having shaped his identity around the aura of omnipotence, Erdoğan cannot easily afford this blow. So how does the president right the ship?

He won't find it easy.

For one, the fundamentals aren't good. The economy is in recession, the unemployment rate is more than 14%, and the inflation rate stands at 18%. The Turkish lira has also plummeted in value against the dollar. This situation will only worsen if Erdoğan persists in purchasing the Russian S-400 air defense system, and reciprocal U.S. sanctions take effect. When the economy was strong, Turks were willing to tolerate Erdoğan's eccentric authoritarianism. It's less obvious whether they will do so as the economy continues weakening.

Then there's the political side.

Now that his weakness has been made evident, Erdoğan's opponents will be inspired to challenge him with new energy. The Kemalist CHP will find particular reason to move against the president: Disgusted by authoritarianism and long abused by Erdoğan's cronies, the CHP views Erdoğan's collapse with mouth-watering excitement.

But Erdoğan's authoritarian excesses also pose another problem, as they have made Turks skeptical of his leadership. Between capital flight and encroaching human rights restrictions, Turkey is an increasingly morose place. That creates opportunities to politicians willing to provide alternatives to the president. Notably this includes some of Erdoğan's former Justice and Development Party, or AKP, allies such as former President Abdullah Gül, who appears ready to set up a new conservative party. This fragmentation of the Turkish Right is bad news for Erdoğan's stability.

All this means that if the CHP can keep boosting its popularity and cooperate with the new iYi centrist party, and rely on quiet support from the Peoples' Democratic Party, or HDP, pro-Kurdish party, Erdoğan's government will face increasing instability. Indeed, it will have to rely heavily on the support of the Nationalist Movement Party, or MHP, a party of hyperaggressive, ultra-nationalist xenophobes. And if any AKP parliamentarians defect to a new party, Erdoğan could face a no-confidence vote and quick new elections.

To be sure, this is only the start of Erdoğan's crisis. But I do believe it is the beginning of the end. Erdoğan's new vulnerability will inject new energy into opposition parties long devoid of it. And the facts of his mismanagement make Erdoğan's popular appeal an increasingly questionable assumption.