KYIV, Ukraine (AP) — Japanese Prime Minister Fumio Kishida made a surprise visit Tuesday to Kyiv, stealing some of the global attention from Asian rival President Xi Jinping of China, who is in Moscow to show support for Russia against the West over the Kremlin’s invasion of Ukraine.

The two visits, about 800 kilometers (500 miles) apart, highlighted the nearly 13-month-old war’s repercussions for international diplomacy as countries line up behind behind Moscow or Kyiv. They follow a week in which China and Japan both enjoyed diplomatic successes that have emboldened their foreign policy.

Kishida, who is to chair the Group of Seven summit in May, will meet President Volodymyr Zelenskyy in the Ukrainian capital, coinciding with Xi’s talks with President Vladimir Putin.

Kishida will “show respect to the courage and patience of the Ukrainian people who are standing up to defend their homeland under President Zelenskyy’s leadership, and show solidarity and unwavering support for Ukraine as head of Japan and chairman of G-7,” during his visit to Ukraine, the Japanese Foreign Ministry said in announcing his trip to Kyiv.

Kishida told Ukrainian officials that he plans to “provide maximum support in order to restore peace in Ukraine.”

Kyodo News said he visited a church in Bucha, a town outside Kyiv that became a symbol of Russian atrocities against civilians, laid flowers at a church there and paid his respects to the victims.

“I’m outraged by the cruelty. I represent the Japanese citizens to express my condolences to those who lost their lives,” he was quoted as saying.

U.S. Ambassador to Japan Rahm Emanuel tweeted about the “two very different European-Pacific partnerships” that unfolded Tuesday.

“Kishida stands with freedom, and Xi stands with a war criminal,” Emanuel said, referring to last week’s action by the International Criminal Court, which issued an arrest warrant for Putin, saying it wanted to put him on trial for the abductions of thousands of children from Ukraine.

Putin warmly welcomed Xi on Monday for a three-day visit the two major powers described as an opportunity to deepen their “no-limits friendship.”

At a meeting Tuesday with Russian Prime Minister Mikhail Mishustin, Xi said he invited Putin to visit China later this year for a top-level meeting of China’s One Belt, One Road regional initiative, which seeks to extend Beijing’s influence through economic cooperation projects.

Moscow and Beijing have both weathered international condemnation of their human rights record. The Chinese government has been widely condemned for alleged atrocities against Uighur Muslims in its far western Xinjiang region. The allegations include genocide, forced sterilization and the mass detention of nearly 1 million Uighurs. Beijing has denied the allegations.

Japanese public television channel NTV showed Kishida riding a train from Poland to Kyiv. His trip comes just hours after he met with Indian Prime Minister Narendra Modi in New Delhi and a week after a breakthrough summit with South Korean President Yoon Suk Yoel.

In New Delhi, Kishida called for developing and Global South countries to raise their voices to defend the rules-based international order and help stop Russia’s war.

Japan, which has territorial disputes over islands with both China and Russia, is particularly concerned about the close relationship between Beijing and Moscow, which have conducted joint military exercises near Japan’s coasts.

Beijing’s diplomatic foray follows its recent success in brokering a deal between Iran and its chief Middle Eastern rival, Saudi Arabia, to restore diplomatic ties after years of tensions. The move displayed China’s influence in a region where Washington has long been the major foreign player.

China looks to Russia as a source of oil and gas for its energy-hungry economy, and as a partner in standing up to what both see as U.S. aggression, domination of global affairs and unfair criticism of their human rights records.

Kyiv’s Western allies have expressed concern that China might help Russia’s war effort, though Beijing insists it is a neutral broker in peace efforts.

Ukraine’s military intelligence spokesman Andriy Yusov said Monday that Kyiv is unaware of any Chinese arms transfers to Russia so far. He told Ukrainian TV that while Beijing has provided some dual-use technology to Moscow, such as semiconductor chips, “there is no talk about weapons so far, and no such (supplies) have been recorded.”

Kishida was the only G-7 leader who hadn’t visited Ukraine and was under domestic pressure to do so. U.S. President Joe Biden took a similar route to visit Kyiv last month, just before the first anniversary of Russia’s invasion.

Kishida, Japan’s first postwar leader to enter a war zone, was invited by Zelenskyy in January to visit Kyiv.

Due to its pacifist principles, Japan’s support for Ukraine has been limited to equipment such as helmets, bulletproof vests and drones, and humanitarian supplies including generators.

Japan has contributed more than $7 billion to Ukraine, and accepted more than 2,000 displaced Ukrainians and helped them with housing assistance and support for jobs and education, a rare move in a country that is known for its strict immigration policy.

Tokyo joined the U.S. and European nations in sanctioning Russia over its invasion and providing humanitarian and economic support for Ukraine. In contrast, China has refused to condemn Moscow’s aggression and criticized Western sanctions against Moscow, while accusing NATO and Washington of provoking Putin’s military action.

Japan was quick to react because it fears the possible impact of a war in East Asia, where China’s military has grown increasingly assertive and has escalated tensions around self-ruled Taiwan, which Beijing claims as its territory.

In Beijing, foreign ministry spokesperson Wang Wenbin said Beijing’s contacts with Russia will help to bring about peace. “President Putin said that Russia appreciates China’s consistent position of upholding fairness, objectivity and balance on major international issues,” he said. “Russia has carefully studied China’s position paper on the political settlement of the Ukrainian issue, and is open to peace talks.”

Asked about Kishida’s trip to Kyiv, he added, “We hope Japan could do more things to deescalate the situation instead of the opposite”.