AFTER 16 uninterrupted years in power, Turkish leader Recep Tayyip Erdogan was unused to losing. Now he has received a major political blow which could mark the beginning of the end of his increasingly imperious and uncompromising rule. On paper Erdogan and his ruling Justice and Development (AKP) party are not due to face the electorate for the next four years. But 2023 must now seem a long way off to Erdogan in the one-thousand room presidential palace he built for himself in the capital Ankara. On Sunday the voters of Istanbul went to the polls for a second time in three months following the triumph of the opposition Republican Peoples (CHP) party in the city's mayoral election at the end of March. The margin of victory for the CHP candidate Ekrem Imamoglu was a wafer-thin 13,000. At first sight, Erdogan's demand the Supreme Electoral Commission order a re-run seemed reasonable. But he made a big mistake. The technical grounds on which he protested the outcome, including the alleged failure of some election officials to be properly appointed, applied just as much to victorious AKP mayors in some of Istanbul's districts. Yet he did not press for a re-run of these elections. This betrayed the reality that Erdogan was not really concerned with the letter of the law but was livid that the opposition had won control of the country's commercial hub, which he himself had run before moving to national politics. Used to a remarkable string of election victories for himself and his party, he clearly assumed that the first Istanbul defeat would mobilize his supporters and he could reverse the humiliation with a second vote. He has paid dearly for this hubris. Instead of another narrow result, Istanbul residents gave the CHP candidate a majority of more than three quarters of a million. This is a devastating rebuff from the people of Istanbul, the city which Erdogan famously said, a party had to win to hold national power. In March, the AKP also lost the capital Ankara to the opposition as well as failing to wrest the country's third main city Izmir from the CHP. There had been speculation that had Istanbul returned to AKP control on Sunday, Erdogan would have moved to have the Ankara result overturned. He can have no such thoughts now. Undoubtedly rising economic hardship has played a major role in these defeats. In his early years, when he was prime minister, Turkey experienced an economic boom. But excessive foreign borrowings by both his government for grandiose infrastructural projects and the expansive corporate sector have seen the economy heading into rising inflation and dangerous recession. But the political push-back is also coming from deepening concerns over the international direction in which Erdogan is taking the country. The alienation of Washington, the close relations with Moscow and Tehran, his considerable backing for the Muslim Brotherhood and the resumed civil war against Kurdish separatists, with whom he once made peace, all seem dangerous adventurism. And it is not simply his traditional political opponents who are worried. There are now clear splits within his AKP, prompted in part by his alliance in last year's general election with the Nationalist Movement (MHP) party. Erdogan has suffered a very possibly fatal blow to the authority he has enjoyed for so long.