With Sino-American tensions escalating amid a monthslong trade war, Prime Minister Shinzo Abe’s visit to China from Thursday to Saturday highlighted an improvement in bilateral relations, but that doesn’t mean Tokyo is about to move away from Washington toward Beijing.

Some foreign affairs experts in Beijing strongly believe that Japan should bolster political and economic ties with China, given U.S. President Donald Trump’s coercive pressure on them to take measures to rectify their trade imbalances with the United States.

However, Japanese government sources have rejected such a view, saying that even though Tokyo and Washington are divided over trade issues, the alliance with the United States continues to be the “cornerstone” of Japan’s diplomacy and security.

Although good relations with China are necessary for stability in East Asia, Japan will maintain an appropriate distance from the neighboring power as bilateral ties remain shaky, with a territorial spat in adjacent waterways unresolved, one of the sources said.

On Friday, Abe agreed with Chinese Premier Li Keqiang that Tokyo and Beijing will form a new type of economic cooperation, while moving ahead with infrastructure projects in developing countries.

“Switching from competition to collaboration, I want to lift Japan-China relations to a new era,” Abe told Li at the outset of their meeting at the Great Hall of the People. “Japan and China are neighbors and partners. We will not become a threat to each other.”

As an intensifying trade war waged by Trump has been sparking fears about a slowdown in the global economy, the Japanese and Chinese leaders also confirmed that they will work together against anti-globalism to promote free trade.

The United States and China, the world’s No. 1 and No. 2 economies, have been engaged in tit-for-tat rounds of punitive double-digit tariffs on hundreds of billions of dollars of each other’s imports since early this year.

Japan has effectively acquiesced to the United States in a shift from opting for a multilateral approach to bilaterally discuss tariffs and resolve trade issues. Trump is aiming to reduce huge U.S. trade deficits with Tokyo and Beijing.

In late September, Trump and Abe agreed to start talks over a trade agreement between Tokyo and Washington. The U.S. president said on Oct. 1, “Without tariffs we wouldn’t be talking about a deal,” blatantly threatening Japan with trade restraints.

A European source in Beijing’s diplomatic circles said, “Trump and Abe appear to be enjoying a close personal relationship, but Trump’s pursuing his ‘America First’ policy could easily break it.”

“To prevent national interests from being hurt by Trump, Japan had better get closer to China both economically and politically,” the diplomat added.

A Japanese government source, however, shrugged off the idea, noting, “I’d like to tell him ‘You don’t understand anything.’ The U.S.-Japan alliance is the most important for us. We will not curry favor with China only because we don’t like Trump.”

“Of course, we think it is good for Japan-China ties to be normalized for stability and prosperity in East Asia. Under appropriate circumstances, Japan and China should create trust and improve the security situation between the two,” the source said.

In recent years, tensions between Tokyo and Beijing have flashed over the Senkaku Islands — Japan-administered uninhabited islets in the East China Sea, called Diaoyu in China.

Bilateral relations reached their worst phase in decades after Tokyo, led by Prime Minister Yoshihiko Noda, Abe’s predecessor, put them under state control in September 2012.

Since late 2017, the ties have been markedly improving, with both sides reflecting positively on the 40th anniversary this year of the signing and taking effect of a friendship treaty between the two nations.

Nevertheless, Stephen Nagy, a senior associate professor of politics at International Christian University in Tokyo, said Japan still regards China as “a revisionist state bent on reestablishing a Sino-centric regional order.”

“Tokyo is realistic about the prospects for real progress in bilateral relations,” Nagy said, adding that Abe has been seeking to return “Sino-Japanese relations to a recalibrated state — one which focuses on deepening economic exchanges while putting aside political problems.”

Other analysts are also skeptical about the optimistic outlook for Japan-China relations.

“Strains between the United States and China may bring a lull in Japan-China ties, but Japan-China relations remain fragile,” said Kazuo Yukawa, a professor at Asia University in Tokyo who is well versed in the diplomatic environment of East Asia.

Yukawa added that Japan should move forward negotiations with China on security and issues of mutual concern at a time when bilateral ties have been improving.

Akio Takahara, a China specialist at the University of Tokyo, urged Abe’s administration to put emphasis on boosting economic cooperation in consideration of U.S.-Japan relations.

“I don’t think that Japan and China’s strengthening cooperation with a focus on the economic field will be detrimental to the national interests of the United States,” Takahara said.