AFTER months of diplomatic tiptoeing, Germany’s patience has run out. On July 18th a Turkish court ordered that six human rights activists, including a German trainer who had been detained during a training workshop with Amnesty International, a human-rights group, should be officially arrested. Two days later Germany’s foreign minister, Sigmar Gabriel, cut loose.

He warned his country’s nationals against travelling to Turkey, proposed rolling back European Union economic assistance and suggested his government might stop providing export credit guarantees to companies doing business in Turkey. “We cannot advise anyone to invest in a country where there is no longer legal certainty and even companies are being accused of supporting terrorists,” he said.

The Turkish government’s repression of opponents and civil-society groups has grown steadily worse since an attempted coup last summer. Over 50,000 people have been jailed on charges of association with the plotters. Previously, Germany and other EU countries had responded to the crackdown with statements of “deep concern”, accompanied by expressions of sympathy over the attempted coup.

That approach seems to be over. In a statement, Mr Gabriel’s ministry accused Turkish courts of taking orders from the government and of “inventing” links between human-rights outfits and terrorist organisations. A spokesperson for Recep Tayyip Erdogan, the president, condemned the German statements as unfounded. Mr Erdogan himself accused Germany of meddling in Turkey’s internal affairs. “Our judiciary is more independent than theirs,” he said on July 21st.

For Angela Merkel, Germany’s chancellor, the arrests of the German activist, Peter Steudtner, and, among others, Amnesty International’s Turkey director appear to have been the last straw. Earlier this year, Turkish police arrested Deniz Yücel, a journalist and German-Turkish dual national, and another German journalist, Mesale Tolu, on terror charges. (Some 160 Turkish journalists are in prison, too.) Those arrests have raised fears that Turkey is using foreign detainees as hostages. According to Bild, a German newspaper, Mr Erdogan proposed swapping Mr Yücel for a pair of Turkish generals whom Turkey accuses of involvement in the coup, and who are seeking asylum in Germany.

The storm has been brewing for over a year. After the Bundestag recognised the World War I slaughter of Ottoman Armenians as genocide in June 2016, Turkey blocked its lawmakers from visiting German troops stationed at a Turkish airbase. (Germany has since announced it will redeploy the 280 soldiers to Jordan.) In March, Turkish ministers were blocked from campaigning in Germany to win Turkish-Germans’ support for a referendum granting Mr Erdogan more power; Mr Erdogan accused the Germans of “Nazi practices”. Mr Erdogan has lambasted Germany for refusing to hand over followers of the Gulen community, a powerful Muslim sect believed by many to have played a leading role in the failed coup. Turkish officials say Germany has become a safe haven for “terrorists”.

Relations between the two countries, already at their most toxic in decades, now seem destined to deteriorate further. There is much on the line. Germany is Turkey’s most important trading partner. Some 6,800 German companies do business in Turkey. The ailing tourism sector relies heavily on German tourists: 3.9m visited Turkey last year, down from 5.6m in 2015. A deal that commits Turkey to stopping migrants from crossing the Aegean Sea, in exchange for EU aid and the promise of visa-free travel to Europe, also hangs in the balance.

Even if Germany and Turkey manage to contain this falling-out, fresh disagreements appear to be inevitable. Mr Erdogan has made a habit in the past of whipping up anti-Western sentiment ahead of elections. European politicians, having found that tough talk on Turkey is popular with their voters, are beginning to reciprocate. Many Dutch ones did so in their election in March, and some in Germany will surely repeat the tactic as its national election approaches in September. The Turkish president has started a dangerous game.