Turkish President Recep Tayyip Erdogan and his party were dealt a setback in recent municipal elections.

The vote indicates growing dismay with Erdogan's government and style of politics.

But Erdogan's party still won the most votes nationally, and many in Turkey are still behind him.

When Istanbul elected a young, Islamist mayor in 1994, it sent a shockwave through Turkey's secular political establishment and marked the beginning of a sea change in the country's politics. Recep Tayyip Erdogan would use the mayoralty of Turkey's largest city as a springboard to national power, which he has now dominated for 16 years.

But on Sunday, his hometown turned its back on him.

In nationwide municipal elections, the coalition led by Erdogan's ruling AK Party (AKP) lost control of a number of key cities, including the nation's capital, Ankara, as well as several coastal centers.

A woman walks past AK Party billboards with pictures of Turkish President Tayyip Erdogan and mayoral candidate Binali Yildirim in Istanbul, April 1, 2019. The billboards read: "Thank you Istanbul." Reuters

But the biggest loss was Istanbul, which has been under the control of parties aligned with Erdogan since he was mayor. This is a significant setback for a leader, and a party, who have won every major election in Turkey since 2002.

The election was above all a referendum on Erdogan's increasing authoritarianism and his handling of the economy.

Over the past several years, Erdogan has vastly expanded his power. After a failed coup against his government in 2016, he purged more than 100,000 state employees and threw a number of journalists in jail. In 2017, he narrowly won a controversial referendum that permitted him to increase the power of the presidency, a position he then won in an election last summer.

In recent weeks, Erdogan campaigned furiously for his party, suggesting to Turkish voters that voting for the AKP was a matter of national survival and sovereignty.

But those voters went to the polls amid an economic recession spurred in part by Erdogan's disastrous economic policies: His approach of spouting conspiracy theories and pumping cash into the economy without worrying about inflation spooked foreign investors last year, leading to a currency crisis that affected the broader economy. What's more, urban voters have become increasingly frustrated with poor management and corruption at the local level in cities controlled by the AKP and its affiliates.

Supporters of Turkish President Recep Tayyip Erdogan at a rally before local elections in Istanbul, March 30, 2019. Reuters

Yesterday wasn't all bad news for Erdogan: the AKP still won far more votes than any other party nationally, and it remains strong in the country's rural heartlands. For tens of millions of conservative Turks, Erdogan is still the man who made their voices heard in Turkish politics for the first time. And they still remember fondly the economic boom years over which he presided.

But losing the big cities means losing control over the country's major population centers and economic hubs, and with them a huge source of cash and patronage that can be doled out to supporters and cronies in the future.

Will Erdogan seek to win those cities back, or will he double down on an even more divisive politics now?

Elsewhere in the world of "throw the bums out": Turkey wasn't the only place where voters flipped on those in power this weekend. Across the Black Sea in Ukraine, comedian Volodymyr Zelenskiy, who plays a president on TV, rang up nearly twice the vote share of the actual president, Petro Poroshenko, in the first round of that country's presidential balloting. Zelenskiy and Poroshenko — a chocolate industry tycoon who won the presidency after Ukraine's 2014 uprising — now head to a Comedian vs Candyman runoff on 21 April.

And next door in Slovakia, pro-EU anti-corruption crusader Zuzana Caputova won the presidency, amid a campaign shaped in part by the murder last year of an investigative journalist who'd unearthed ties between government officials and organized crime. Although Slovakia's presidency is a largely ceremonial office, the triumph of Caputova, a political newcomer and the country's first female president, flies in the face of recent gains for macho right-wing Euroskeptic parties elsewhere in Central Europe.