GERMANY has long considered itself a bridge between east and west Europe. Karel Schwarzenberg, a Czech former foreign minister, recalls Helmut Kohl telling him in the 1990s that, having tethered itself to the West during the cold war, his country now had to tether itself to its east, lest it “slide about like loose ballast on a ship”. Kohl’s point was that a Germany alienated from its eastern neighbours, particularly the “Visegrad” (V4) states of Poland, the Czech Republic, Slovakia and Hungary, would destabilise the European vessel.

But its relations with the V4 have recently hit a low. The picture is not uniform. From Berlin, the Czech Republic and Slovakia look friendlier than Hungary or, particularly, Poland. But there is a sense that the region is drifting away. “People here are seeing that they have taken the Visegrad for granted for too long,” says Milan Nic of the German Council on Foreign Relations.

Germany’s size is part of the problem. The V4 felt (literally) marginalised by Angela Merkel’s decision to keep her country’s borders open to refugees at the peak of the crisis in 2015. Without consultation, it seemed to them, the chancellor had turned them into transit corridors for undesirable migrants drawn by the promise of a cushy life in Germany. Their irritation turned to anger when she later urged every EU state to admit a quota of refugees.

Its economic might, too, is daunting. Germany’s trade and investment flows with the V4 are greater than with China. That inspires both gratitude and resentment. Recently, the Czech and Slovak prime ministers berated German firms for paying local staff less than those in their German plants. A widely shared analysis by Thomas Piketty, a French economist, shows outflows of profits from such foreign investments in the V4 outweighing EU transfers to the region.

Residual memories of the second world war make it “very easy for authoritarian [V4] governments to exploit anti-Germanism”, notes Thorsten Benner of the Global Public Policy Institute. That is clearest in Poland, whose populist Law and Justice (PiS) leadership has reopened the issue of war reparations, passed a “Holocaust law” banning references to Polish complicity in Nazi atrocities and issued an advertising campaign promoting the term “German death camps” (referring to Nazi death camps in Poland). Viktor Orban, Hungary’s nationalist prime minister (pictured, with Mrs Merkel, has endorsed the construction of a “memorial to the victims of the German invasion” in central Budapest. Berlin does not always help its own cause. On May 4th construction began on Nordstream 2, a gas pipeline between Russia and Germany which bypasses Poland and inflames historical fears of being caught between the two powers on either side.

Yet the tensions along its eastern border also demonstrate the limits to German power. For all its economic heft, Berlin has not been able to get the V4 states to take in a few hundred refugees. These days, Mrs Merkel talks more about controlling Europe’s outer borders than about managing the burden of refugees who cross them—the V4’s order of priorities. Meanwhile, Germany’s leaders feel unable to do much about the march of authoritarianism within the EU, which is most acute in Poland and Hungary. “Wagging our finger at Warsaw will only make things worse,” sighs an official in Berlin, talking of Polish attacks on the independent press and judiciary. Similar considerations explain Mrs Merkel’s marked reluctance to condemn Mr Orban’s assaults on NGOs and his flirtation with anti-Semitism. Her Christian Democrats are a bulwark against calls to expel his Fidesz party from the European People’s Party, the umbrella group of the continent’s centre-right. One explanation for this German caution is the growing presence in the V4 of rival influences. China in particular has ploughed in investment (funding a new railway from Budapest to Belgrade, for example). In January, amid suggestions that the EU could cut financial transfers to Hungary and Poland, Mr Orban told business leaders in Berlin: “We need financing for new roads and pipelines. If the EU can’t provide it, we’ll get it from China.” Two months later the Chinese foreign minister called the V4 “the most dynamic force in the EU”. His government is interested in funding Poland’s “Intermarium”, a scheme to integrate central Europe along a new north-south axis linking the Baltic and Adriatic seas. Some German policymakers consider America in the same category. On June 4th Donald Trump’s new ambassador to Berlin raised hackles when he said he wanted to “empower other conservatives throughout Europe”—apparently a reference to V4 governments. Germany’s leaders are divided on what to do. Some, especially in business and in the Christian Social Union (CSU), Mrs Merkel’s conservative Bavarian sister party, are for cosying up to the V4. The CSU even invited Mr Orban to its party conference in January. Others, like Joschka Fischer, Germany’s former foreign minister, think the country should deepen integration with France and relegate the V4 to an outer ring of partners. Germany’s government is closer to the first pole, delegating the policing of democratic norms to the EU while rewarding the Czechs and Slovaks, tolerating Mr Orban and resetting relations with Poland. Mrs Merkel visited Warsaw immediately after Paris on being re-elected chancellor, to stress that new co-operation with France should not marginalise the V4.

In their gloomier moments, Germans fear things could get much worse. The Frankfurter Allgemeine Zeitung recently speculated about “Polexit”, or Poland quitting the EU. A Bundeswehr planning scenario leaked in November imagined the EU’s eastern states splitting off and joining an autocratic, Eurasian block by 2040. None of this is likely. But the fears alone point to the endurance of Kohl’s conviction that a stable Europe requires Germany to be surrounded by close allies. Economic walls have fallen, but new ones have arisen—walls separating different value systems that seem impossible for the continent’s “semi-hegemon” to remove.