And it's also an opportunity for the future.

That was the message from Chinese President Xi Jinping on Tuesday as he met German leader Olaf Scholz.

His comments come amid complaints by the EU about Chinese goods flooding the bloc's markets.

Xi said industrial and supply chains of China and Germany are deeply interconnected and their markets highly interdependent.

Scholz's three-day visit to China was his first since his government launched a "de-risking" strategy last year to avoid relying excessively on suppliers from the country.

His trip also coincided with EU concerns about the threat to European businesses from Chinese goods flooding its markets.

That includes electric vehicles and other green technologies.

EU Commission president Ursula von der Leyen has complained about China's overproduction being unfairly supported by "massive" state subsidies.

But Xi warned both Germany and China should be vigilant against what he called rising protectionism.

Scholz has been cautious about pushing away China.

It is an important market for Germany, and he has said the EU should not act out of protectionist self-interest.

But Scholz said in Shanghai on Monday competition between China and Germany ought to be fair.

He was joined on his trip by senior auto executives like Ola Kallenius from Mercedes-Benz, and BMW's Oliver Zipse.

Both spoke of a willingness to keep working with China.