A new day begins in Turkey, as President Recep Tayyip Erdoğan’s party lost the Istanbul mayoral election for the second time this year. After the March 31 election resulted in 48.8 percent in favor of Ekrem Imamoglu versus 45.55 percent for former Prime Minister Binali Yildirim, Erdogan’s Justice and Development Party (AKP) immediately requested a full recount. After it was verified that Imamoglu of the Republican People’s Party (CHP) had indeed won, he was officially sworn in as mayor.

That didn’t deter the AKP from further contesting the election, however. It petitioned the Supreme Electoral Council (YSK) for the results to be nullified and a new election to be held, a request the council ultimately granted. To ensure electoral integrity, lawyers from around the nation traveled to Istanbul. All 2,000 booths in the do-over election had a lawyer present. The idea to have lawyers monitor the election process actually came from the CHP as a preemptive measure to prevent the AKP from manipulating the results or claiming they were invalid.

Sunday’s election delivered an even harsher blow to Erdogan’s party: Imamoglu won over 54 percent of the vote when the election was called in his favor and Yildirim conceded.

Istanbul’s mayoral election is not simply about control over the city, but of Istanbul itself. Erdogan once said, “Whoever loses Istanbul loses Turkey.”

Erdogan has been at the helm of Turkey’s politics since serving as Istanbul’s mayor in the mid-1990s. The AKP has held onto power for two decades. Considering the fact that Erdogan founded the party in 2001 and has served in number of positions including 11 years as prime minister, the sound defeat is a stunning blow to Erdogan himself.

Economic conditions and a loss of civil liberties likely played a role in the election of Imamoglu who promised a return to democracy. Now Imamoglu will be challenged with leading a city that has the power to alter politics on the national level, as evidenced with the rise of Erdogan 20 years ago.

Imamoglu and Erdogan could not be more different. While the president is paranoid, the new mayor is calm. Where Erdogan preaches populist politics and seeks to divide, Imamoglu campaigned on unity and inclusion.

For most of Erdogan’s rule, Turkey has prospered, weathering the financial crisis that struck the U.S. in 2008, as foreign investors flooded his nation. However, that growth could only be sustained for so long and now, faced with a stronger U.S. economy, foreign investment has run dry. Both inflation and unemployment have begun to skyrocket, spelling possible doom for the AKP.

To make matters worse, Erdogan has taken an authoritarian approach to civil liberties with a major emphasis on restricting the media and silencing unfavorable or opposing views. He’s used the court system and prison to punish opposition, journalists, and activists. Tens of thousands are estimated to be imprisoned under the guise of protecting the country from terrorism, often blamed on the Kurds.

As recently as 2017, the Turkish were seemingly fine with all of this. They voted 51.41 percent in favor of a 2017 constitutional referendum which eliminated the prime minister position and entrusted the president with more power.

As with his civil liberties crackdown, Erdogan pitched the referendum as a security measure. In fact, the 18-point plan was designed and voted on following a 2016 coup attempt. Many have speculated that the coup might have actually been designed by Erdogan himself to create an emergency situation in preparation for a power grab. Speaking about the coup, he called it “a gift from God.”

A Turkey without Erdogan and his AKP in power has been difficult to fathom in light of his siege of power, but with Sunday’s election, it became clear that it may be possible in the coming years. More so, the election, a rousing defeat of Erdogan’s party in Istanbul, Ankara, and Izmir, was the first sign that Turkish voters are beginning to sour on the president’s policies. Critically, their willingness to rebuke the AKP shows they are unafraid and undeterred by Erdogan’s brutal tactics at suppressing his opposition.

While Imamoglu won the mayor’s office, he will still be forced to contend with the AKP, which continues to hold a majority of the municipal seats. Politics is often compromise, however, and if he can do so effectively, he might be leading all of Turkey one day. After all, Erdogan was built in Istanbul; perhaps that is why he was so threatened by Imamoglu.