ALL they were hoping to do, said the organisers of an art festival in Wiesbaden, a small city on the banks of the Rhine, when they installed a four-metre statue of Recep Tayyip Erdogan in the town’s central square in late August, was to spark a debate about the Turkish president and free speech. They got one, and then some. Some locals lit candles near a sign bearing the words “press freedom” that had been placed by Mr Erdogan’s feet. A woman spat on the statue. Others covered it with graffiti. Scuffles broke out between the strongman’s Turkish supporters and his Kurdish opponents. Fearing more trouble, the mayor ordered the fire brigade to have the statue pulled down, barely a day after it was erected.

German police may face much bigger protests when the real Mr Erdogan touches down in Berlin on September 28th for his first official visit to Germany, Turkey’s NATO ally and its biggest trade partner, in over four years. He has not been missed. Germany is home to around 3m people of Turkish origin, almost two-thirds of whom voted to give Mr Erdogan sweeping new powers in a controversial referendum in 2017 and to re-elect him as president a year later. This came as a shock to the rest of the country. Dislike of Mr Erdogan is one of the few things that unites all Germany’s political families. Leftists and greens accuse him of mass human-rights violations, especially in Turkey’s Kurdish south-east. The far right resents his support for mosque-building in Germany. Even centrists, led by Chancellor Angela Merkel and her Christian Democrats, cringe at Mr Erdogan’s brand of Islamic nationalism and his clampdown on dissent.

Relations reached rock-bottom last year. At least 30 German citizens ended up behind bars in Turkey, part of an avalanche of arrests that followed a failed coup. Mr Erdogan personally accused Germany of sheltering some of the putschists. After German officials blocked Turkish ministers from stumping for him across the country, he compared them to Nazis. Mrs Merkel’s government responded by cutting state credit guarantees for exports to Turkey and pulling German troops out of a Turkish air base.

Mr Erdogan now seems to have no choice but to start rebuilding the bridges he has burned. Turkey’s economy is on the brink of recession. The lira has lost more than 40% of its value against the dollar since the start of the year, a nightmare for banks and Turkish companies saddled with debt denominated in dollars. The currency briefly rallied after a whopping 6.25 percentage-point rise in interest rates by the central bank on September 13th, only to erase most of its gains in less than a week. Inflation is near 18%. Foreign investors are staying away.

Relations with America are the worst in over four decades, plagued by the fallout from Turkey’s arrest of an evangelical pastor, Mr Erdogan’s decision to shop for a missile-defence system in Russia and the Pentagon’s support for Kurdish insurgents in Syria. Even the rapprochement with Russia is on a shaky footing, despite a recent deal that buys Turkey additional time to avert a new massacre by the Syrian regime on its doorstep in Idlib province (see article). Mr Erdogan needs a reset with Germany, says Mustafa Nail Alkan, an academic at Gazi University in Ankara. “Turkey needs a partner whom it can trust,” he says.

The view from the chancellery

Germany is also keen to normalise ties and help avert an economic disaster in Turkey. A serious downturn might tempt Mr Erdogan to rethink his commitment to a deal that prevents hundreds of thousands of Syrian refugees from reaching the EU. With the anti-immigrant party, Alternative for Germany, looking over her shoulder, Mrs Merkel’s job would be on the line if Turkey backed out of the deal.

Signs of a thaw are hard to miss. Mr Erdogan and his friends in the media have toned down their polemics. Most of the German nationals in Turkish prisons, including two journalists, have been released. (Seven remain under arrest, however, and an Austrian journalist and activist was detained on September 11th.) Officials in Ankara are now talking about a new start in relations with the EU. Mrs Merkel’s government, meanwhile, has come out against America’s decision to impose economic sanctions on Turkey, scrapped its own export-guarantee limits and made it clear that a collapse of the Turkish economy is in nobody’s interest. According to a report in Der Spiegel, two German companies, Siemens and Deutsche Bahn, are hoping to take part in a €35bn overhaul of Turkey’s rail network. Turkey would like Germany to help finance the project.

Caution is in order. Much as Mr. Erdogan might like to thumb his nose at the International Monetary Fund, the likelihood of Germany giving Turkey a bail-out with few strings attached is close to zero. “Germany will not go behind the IMF’s back,” says Marc Pierini, a former EU ambassador to Turkey. Given Turkey’s sorry rule-of-law and human-rights record, any progress in its accession talks with the EU is also out of the question. In theory, Turkey could make some headway with the Europeans in talks on a new customs union and visa-free travel. In practice, these would require economic and political reforms that the Turkish government appears to have no intention of passing. Mr Erdogan did not spend years constructing a system of patronage that reaches into most corners of the economy and the bureaucracy just to dismantle it at the first sign of a crisis.