WHEN members of America’s Congress passed the Magnitsky Act in 2012 to pursue Kremlin officials responsible for the death of a Russian whistleblower, and even when they extended it to include foreigners involved in corruption and human-rights violations, few of them imagined the law would ever be used against the government of a NATO ally.

Yet that is precisely what happened on August 1st, when the US Treasury Department imposed an asset freeze on two senior Turkish officials, the ministers of justice and the interior, over their role in the prolonged detention of an American pastor. True to form, Turkey responded by announcing sanctions against two members of President Donald Trump’s cabinet. Both sides, including Turkey’s president, Recep Tayyip Erdogan, suggested that they would find a way out of the crisis, but the markets seem to think otherwise. The Turkish currency set record lows against the dollar for six consecutive days, while the yield on government bonds reached a new high, threatening to plunge the country’s economy into crisis.

Only two weeks ago, Turkey and America were on the brink of an agreement that could have paved the way for progress on a range of tricky issues. Turkey was to release the pastor, Andrew Brunson, who had languished in prison since his arrest on farcical terrorism charges in late 2016, while America would allow Hakan Atilla, a Turkish banker convicted of violating the embargo against Iran, to serve the rest of his sentence at home. The deal reportedly collapsed after Turkey’s foreign minister upped the stakes, asking American officials to kill any investigation into Halkbank, the state bank for which Mr Atilla had worked. Instead of being set free, Mr Brunson was transferred to house arrest.

Given the exasperation with Turkey’s government in America, the sanctions decision should not have come as a surprise. Since his first meeting with Mr Erdogan last year, when the American president brought up Mr Brunson on three separate occasions, the Trump administration has relentlessly called for the pastor’s release. “Both the executive and legislative branches have exhausted their strategic patience,” says Amanda Sloat, a former State Department official now at Brookings, a think-tank.

blog-post__inline-image blog-post__inline-image–generic blog-post__inline-image–slim”>

It may be too early to tell whether the Treasury decision was a shot across the bows, meaning that there remains room for a compromise, or whether new sanctions are inevitable; talks were continuing as The Economist went to press. But many sanctions are in the pipeline already. One bill recently approved by the Senate threatens to block Mr Erdogan’s government from taking delivery of 100 F-35 fighter jets in retaliation for its purchase of a missile-defence system from Russia. Another proposes that America lean on international financial institutions like the World Bank and the European Bank for Reconstruction and Development to suspend loans to Turkey until it releases Mr Brunson and three local employees of American consulates detained over the past year.

For a country hooked on capital inflows, saddled with $220bn in corporate debt and now faced with a spiralling currency crisis, fresh sanctions could be devastating. Even the largely symbolic measures levelled against the two Turkish ministers, coupled with news that America would review duty-free access for $1.7bn-worth of imports from Turkey, were enough to prompt one of the worst runs on the lira in over a decade. On August 6th the currency suffered its biggest daily net loss against the dollar since 2001. It has shed almost a third of its value over the past year. Since Mr Erdogan took over as prime minister in 2003, it has lost almost 70% of its value.

More generally, the economy has been in trouble for some time. Amid a glut of cheap credit and fiscal spending, inflation has climbed relentlessly, hitting nearly 16% last month, the highest rate since 2003. The collapse of the lira has forced a number of leading Turkish companies to restructure billions of dollars in debt. Some might now be on the brink of default. Under pressure from Mr Erdogan, who thinks high interest rates produce inflation, an idea about as popular with economists as the notion that the Earth is flat, and who insists on growth at all costs, the central bank has consistently done too little too late to contain the damage. To the surprise of most analysts, the bank did not raise rates at its most recent meeting on July 24th. With inflation rising, the lira may have to weaken further to keep Turkish exports competitive, says William Jackson, an analyst at Capital Economics. The most the bank can probably hope to achieve, he says, is to manage the currency meltdown.

Investor confidence is ebbing away. The end of the state of emergency on July 18th has not improved sentiment nearly as much as expected. Many of the government’s emergency powers, including the right to sack judges and civil servants on vague national-security grounds, have found their way into a new security law. Others have been enshrined in a constitution that tightens Mr Erdogan’s grip on the executive, allowing him to appoint and replace senior officials at will, and weakens parliamentary oversight. Fresh from an election victory, the Turkish strongman now seems poised to take even greater control of monetary and fiscal policy. Mr Erdogan has ditched his old economic team in favour of relatively untested loyalists, including his son-in-law, Berat Albayrak, whom he appointed as the finance and treasury minister. None of those moves will improve investors’ confidence.