German Chancellor Angela Merkel said China risks facing investment “constraints” in Europe unless it further opens its home market, even as both sides pledged to defend global institutions against U.S. attacks.

Standing alongside Chinese Premier Li Keqiang in Beijing, Merkel told reporters Thursday that both are “committed to free and fair trade.” For his part, Li signaled backing for European efforts to uphold a nuclear accord with Iran that President Donald Trump is abandoning.

A range of disagreements with the U.S. administration put Merkel in a difficult situation in looking for compromise with China. While Trump’s trade demands risk cutting into German exports to China, she shares many of the U.S.’s concerns about market access to China and Beijing’s investment abroad.

“We understand that China is still developing, but we also see that in some areas China is the absolute technology leader,” Merkel said at a Germany-China business forum she attended with Li. “So in these areas we naturally want reciprocal access. Otherwise, this will gradually lead to us putting in place constraints—perhaps too many constraints, and that wouldn’t be good.”

Iran Accord

Li praised Germany’s effort to preserve the Iran accord, telling reporters it “deserves to be defended.” Merkel cited the prospect that Chinese companies might maneuver to take advantage if U.S. sanctions on Iran prompt European businesses to pull out.

“That is a decision that the Chinese government will have to make,” Merkel said at the news conference. “Regardless, we are united in our intention not to let this agreement lapse.”

Merkel arrived in China to an announcement that the Trump administration is investigating whether foreign vehicle imports threaten America’s national security, a move that could lead to new tariffs. That follows China’s pledge to buy more American goods as part of a deal to avert a trade war with the U.S.

In both cases, Germany has the most to lose among European countries. German companies are the European Union’s biggest auto exporters to the U.S. and Germany is China’s biggest European trading partner, with a total volume of some $179 billion last year.

Self-Driving Cars

The chancellor—making her first visit to China since securing a fourth term in March—stressed her desire to expand trade ties with the world’s second-largest economy. She said German companies would seek to take advantage of China’s efforts to open up its economy, citing the financial sector and emerging technologies like self-driving cars.

“We know that China is increasingly investing in Germany,” Merkel said. “I want to expressly say that for us that’s appropriate.”

China has bought or invested in European assets amounting to at least $318 billion over the past 10 years, according to data compiled by Bloomberg, a figure that’s approximately 45 percent more than the equivalent in the U.S. Germany is Europe’s largest economy.

Li acknowledged that German companies had “encountered some problems” while operating in China, citing a lack of protections in local laws and regulations.

“We’ll abide by Chinese law and ensure that we protect the rights of German firms that invest in China,” Li said. “If we do have some rules that can’t meet the requirements of better attracting German investors, we’ll make appropriate adjustment according to the actual demands.”