After 15 years in power as prime minister and president, Tayyip Erdogan faced down a weak opposition in June elections that swept away any checks and balances to the unchallenged rule he wanted. In Turkey he appears lord of all he surveys.
Erdogan has limited options. Most involve a loss of face or a loss of sovereignty for which he alone would be blamed, having successfully marginalised not just a divided opposition but his own Justice and Development Party (AKP).
His victories in June were decisive. Re-elected as president under a new order modelled more on Vladimir Putin's Russia than France or the United States, he also secured a parliamentary majority by allying with far-right nationalists.
The role of prime minister was abolished, leaving Erdogan to dominate not just the executive - appointing ministers, chairing the cabinet and replacing top civil servants with political appointees - but also holding sway over the judiciary and the legislature.
Having chosen to rule alone from his vast neo-Ottoman palace in Ankara, he confronts the spiralling crisis alone.
The lira has collapsed by 40 percent this year. Turkish banks that borrowed heavily abroad now face the near impossible task of refinancing short-term debt in expensive dollars and euros.
Investors rattled by soaring inflation and a widening current account deficit were suddenly confronted by a row between Erdogan and Trump, who doubled tariffs on U.S. imports of Turkish steel and aluminium in an attempt to force Ankara to release Andrew Brunson, an evangelical Protestant pastor jailed after an attempted coup in 2016.
Speaking last month at the anniversary of an 11th century Turkish victory over the Christian Byzantine empire, Erdogan told Turks not to believe the dispute with the United States was about him. "No, their issue is Turkey. The issue is Islam," he thundered.
This plays well with his base and, since Trump has used tariffs as a political reprisal, means most of the opposition will line up behind the Turkish president.
But the issue Erdogan most urgently has to confront is cash.
According to JPMorgan, $179 billion in Turkish foreign debt matures in the year to July 2019, $146 billion of which is owed by the private sector - especially Turkey's banks - which borrowed abroad but often earns mostly in lira, saddling it with a severe debt mismatch given the plummeting currency.
The question is now whether Erdogan will make up with Trump - as recently as July's NATO summit they were seen fist-bumping - perhaps at this month's U.N. general assembly. One source close to the AKP, speaking not for attribution, thinks he will.
"Brunson is a tool, cosmetic but important," the source said, refusing to be drawn on whether Turkey would first have to deliver him back in a signal to Trump's evangelical Protestant supporters ahead of November's mid-term elections.
The source believes Turkey will tilt back towards the European Union, where its bid for membership has all but expired. Ankara has high hopes that Germany, which Erdogan visits this month, may lead European efforts to shore up Turkey financially.
But any EU aid is unlikely to be enough. A pledge by Qatar, Turkey's closest Arab ally, to invest $15 billion has had little impact.
"The economy is a big concern because people are getting poorer" the source close to the AKP said. "In all these years we didn't invest, except in construction, and we cannot eat that. We missed trains like investing in technology and industry."
As inflation spikes, the central bank is signalling a rise in interest rates next week to brake the lira's free-fall.
But given Erdogan's belief that interest rates, which he calls the "mother and father of all evil", are a cause of inflation, any hike may be too little and too late.
That increases the likelihood that Turkey may have to go to the IMF for the size of bail-out it needs. The government rules this out as an unacceptable surrender of sovereignty.
"Going to the IMF would be a very big challenge," said the source, "since we used to bash it frequently in our campaign slogans and we were very proud of ridding ourselves of the IMF burden" after the 2000-01 financial crisis shortly before the AKP came to power.
However the source said Erdogan is good at explaining things to the nation and has near total control of the media.
US WAR ON TURKEY
Mustafa Sentop, deputy speaker of parliament and the AKP's former election campaigns chief, says the Turkish economy is in reasonable shape when benchmarked against comparable emerging markets. "We don't believe Turkey will have a problem in funding this debt," he said.
He says the real problem is a U.S. effort to control the region and isolate Turkey's neighbour Iran. Erdogan is an obstacle in Washington's path, and "Brunson is just a symptom of this".
"This is not a conflict between Turkey and the U.S., it is a war by the U.S. on Turkey and other parts of the world, targeting Russia, China and even the EU. They are trying to use the economy and especially currencies," he said.
"Either the world unites against the cowboy behaviour and tyranny of Trump and fights back or we kneel," Sentop said. "But Turkey will never kneel."
Washington has turned the Brunson affair, one of several disputes it has with Turkey, into the central issue to be resolved as a condition of any armistice.
Last year Erdogan linked the cleric's release to the U.S. extraditing Fethullah Gulen, a Pennsylvania-based imam and former AKP ally who Turkey says was behind the abortive but violent putsch of July 2016.
Trump last month demanded the unconditional release of Brunson, calling him a "great patriot hostage", after the collapse of a deal that might have freed him.
In exchange, analysts say Turkey would have got three things: the repatriation of an executive from the state-owned Halkbank who was convicted of breaking sanctions on Iran, the reduction of a fine still to be imposed by the U.S. Treasury on Halkbank, and Trump's intercession with Israel to free a Turkish woman held as a courier for Hamas.
The government may "muddle through" for a while, one academic says, but mass unemployment and unrest may result if Erdogan does not take action.
"This country is too big to sink with him," said one liberal critic who requested anonymity, "But his power base will shrink with this depreciation." Erdogan's emphasis on foreign plots "translates into votes for the (ultra-nationalist) MHP, not the AKP".
"I think it is impossible for him to maintain this level of support in the face of economic collapse," said a former AKP activist.