Timur Kuran and Dani Rodrik are right about how a country’s economy could change from good to worse within a decade. While external factors may play a role, Turkey’s woes are home-grown. After a sharp downturn in 1999-2001, economy grew by 5% a year on average, since Erdogan’s AK party came to power in 2002. The staggering annual inflation rate of up to 100% was reduced to single digits, while GDP rose by more than 45% in real terms.

Turkey was stable, despite wars and turmoil in the region. Its banks avoided the boom-bust cycle of the past, having learned from the banking crisis in 2000-2001. Inequality had fallen. And the government won three consecutive elections, each time with a greater share of the popular vote. In his 2014 new year's speech, Erdogan renewed his goal to bring the country into the top 10 world economies by 2023, the year of the republic's centennial.

But Turkey’s economy was debt-fuelled, boosted by “easy credit.” Its growth relied heavily on a “steady flow of foreign capital to finance domestic consumption and flashy investments in housing, roads, bridges, and airports” – all first class infrastructure thanks to advanced engineering. A high-speed railway links Ankara with other parts of the country. Despite the lack of oil and gas resources, its industry and services were competitive. Tourism alone attracted some 36 million visitors in 2012, making Turkey one of the world's top destinations.

Unlike today – Erdogan’s ministers are “selected more for their loyalty (and family ties to him) than for their competence” – Turkey’s economy was managed by a team of technocrats, led by the deputy prime minister, Ali Babacan, who stuck to basics and looked to the long term. Step by step, his strategy to rebuild the banking sector, get the budget under control, and invest heavily in infrastructure, education, health, and technology, bore fruit.

Before Erdogan ditched science and introduced a new school curriculum focusing on more Islam, Turkey's universities were flourishing. Ankara became a hub of higher education, attracting students from Africa and Asia, offering top programmes in English, while ensuring that Turkey would attract an increasing number of international students. It began to invest in sustainable technologies, taking advantage of its wind, geothermal, and other renewable energy, hopping to become a global exporter of advanced green innovations.

On the diplomatic front Turkey was a staunchly moderate voice in a region dogged by Islamist extremism. Foreign Minister Ahmet Davutoglu was the architect of its “zero problem with the neighbours’ policy,” which aimed to help Turkey not only to maintain its own internal balance, but also to win markets and keep friends without the heavy baggage and risks of divisive geopolitics.

Turkey's political stability began to unravel after the eruption of a corruption scandal that led to the resignation of four cabinet ministers and a summer of street unrest in 2013, shaking Erdoğan's international credibility. The investigations triggered a record low of the Turkish lira and a huge sell-off of Turkish stocks. Since then the country descended gradually into autocracy. The failed coup in July 2016 led to a massive crackdown involving “80,000 arrests, 170,000 firings, the closure of 3,000 schools, dormitories, and universities, and the dismissal of 4,400 judges and prosecutors.”

The author says, Erdogan “claims credit for whatever goes well and blames dark forces – often unnamed foreign conspirators – for failures.” His self-veneration, self-delusion of infallibility, “and ultimately political survival are portrayed as Turkey’s supreme goals.” Everything else that does not serve his interests, “takes a back seat to strengthening his rule. And in return for his sacrificial services to the Turkish nation, he is entitled to be above all laws and to enrich himself and his close associates.”

This self-serving behaviour “harks back to the Ottoman ‘circle of justice’ that divided the population into taxpaying masses and a small tax-exempt elite headed by a sultan who was subordinate only to the Sharia (Islamic law), though in practice he himself defined what it meant. The ‘circle of justice’ was officially repealed in 1839, through an edict that ushered in an era of restructuring. Nearly two centuries later, Erdogan has taken Turkey back to a past that generations of reformers tried to leave behind.”

Now he has fallen out with the Trump administration, that has decided to use sanctions “(and the threat of more)” to press Turkey to release Andrew Brunson, an American evangelical pastor based in Izmir, who was arrested during the purges following the 2016 failed coup. It remains to be seen whether Erdogan will win this tug-of-war, and whether he is still optimistic that Turkey would join the exclusive club of the world’s top ten economies in 2023 to mark its centenary as a republic.