As Germany's deputy foreign minister, Wolfgang Ischinger had unique insight into Germany's friendly approach to Beijing.
"Our China policy had one key component: how can we sell the largest possible number of German automobiles in China," Ischinger, who now chairs the annual Munich Security Conference, recalled in an interview in Berlin.
Since Ischinger's time in office at the turn of the century, Germany's view of China has been turned upside down. The idea that Beijing would adopt more western values and democratic practices proved to be completely wrong, he said. If anything, "it's going in the opposite direction", he added.
With governments from Japan to Canada and Australia taking a harder line on China as President Donald Trump steps up his trade war, Germany too is toughening its policy toward China on matters such as investment or intellectual property. But it’s an especially high-risk strategy for Berlin at a time when its export-dependent economy is flirting with recession.
Chancellor Angela Merkel faced a particularly delicate set of policy goals when she visited China this week with a delegation of German company executives: maintaining that hard line on Beijing while urging a resolution of the trade war and continuing to press for reciprocal access to China's lucrative market.
According to a Chinese official who asked not to be identified commenting on policy, Trump's attempts to lobby European leaders such as Merkel appear to have worked in the short term. Trump has provided a model for world leaders to be globalist in their words and protectionist in their actions, the person said.
Indicative of that balancing act is Merkel's approach to the unrest in Hong Kong. While declining an invitation to meet with protesters, she adopted a more forceful tone after discussing Hong Kong with Chinese leaders in Beijing on Friday.
"I advocated for the peaceful resolution of conflicts and said that, in my view, anything else would be a catastrophe," Merkel told reporters during a stop in Wuhan on Saturday.
"I was listened to, and that is important, just as it’s important to keep talking."
Germany is China's biggest European trading partner by a long way, with bilateral sales worth some $195bn last year.
That, plus her sheer political longevity, gives Merkel clout that eludes her European partners: she is making the 12th trip to the Asian giant of her almost 14 years in office.
Germany is also one of few western countries to run a trade surplus with China, with automakers such as VW and BMW now more dependent on Chinese sales than those in the United States. Still, that reliance is viewed in Berlin as a potential liability as well as an achievement.
How Europe's exporting giant went from a key China proponent to the leading advocate of a more defiant European stance is both a reflection of Beijing's rising global power and an indication of how it is wielding that clout.
Germany has been a target of China’s ambition, as a focus of Chinese moves to buy up strategic companies as well as at the apex of concerns including cyber security.
A turning point was the public and political backlash over the takeover of German robot maker Kuka AG by China’s Midea Group Co. in 2016. Germany learned from losing one of its industrial pearls and last August for the first time vetoed a potential Chinese takeover, of German machine tool maker Leifeld Metal Spinning AG, angering Beijing in the process.
German Economy Minister Peter Altmaier has pushed an industrial policy of encouraging European champions to better compete against Chinese giants, even though a proposed merger of Siemens and Alstom train units was blocked in Brussels.
There are signs that German industry is in lockstep with the government’s aims. In January, Germany's industry lobby BDI announced a turnaround in its China strategy, labeling China a "systemic competitor" and arguing that "German industry must prepare itself for this new reality," while the system of open markets in Europe "must be made more resilient".
Germany's dilemma is sharpened by China's moves to divide the European Union, both through the so-called 16+1 forum with eastern European states and by signing up individual EU members including Malta and Italy to President Xi Jinping's Belt and Road infrastructure program.
The upshot is that while all 27 member states have stood together on Brexit, the European Union struggles to speak with one voice on China policy.
Still, alongside German legislation to protect companies, the EU has acted to tighten up investment scrutiny, brought in instruments to tackle dumping of steel and measures to shield IT. China policy is not about to soften under the incoming commission, according to a senior EU official with knowledge of trade issues.
China is angry about the measures, but the EU will hold to its stance even as the economy staggers because it sees a risk China could ramp up exports subsidies even more, the official said.