BEIJING (Reuters) - Chinese President Xi Jinping urged a peaceful resolution of tension over North Korean on Thursday, telling his South Korean counterpart that China is committed to denuclearization of the Korean Peninsula.

Chinese President Xi Jinping speaks during a meeting with his Russian counterpart Vladimir Putin at the Kremlin in Moscow, Russia July 4, 2017. REUTERS/Sergei Ilnitsky/Pool

The United States said on Wednesday it was ready to use force if need be to stop North Korea’s nuclear missile program but said it preferred global diplomatic action against it for defying world powers by test launching a ballistic missile that could hit Alaska.

Meeting in Germany ahead of a G20 summit, Xi told South Korean President Moon Jae-in that China upheld maintaining the peace and stability of the peninsula, and that all sides should strictly abide by U.N. Security Council resolutions, China’s state news agency Xinhua reported.

China supported the new South Korean government’s efforts to restart dialogue and contacts with North Korea, Xi said, adding that the international community should work together to play a positive role to ease tension.

Ties between China and South Korea have soured over the basing in South Korea of an advanced U.S. anti-missile system China sees as a threat to its own security, despite Washington and Seoul saying it is purely to defend against North Korea.

Xi told Moon that China did not want to see the “difficulties” that have been present in relations of late, and that South Korea should “clear obstacles” to bilateral ties and pay attention to China’s “legitimate concerns”.

The news agency did not elaborate.

Taking a major step in its missile program, North Korea on Tuesday test launched an intercontinental ballistic missile that some experts believe has the range to reach the U.S. states of Alaska and Hawaii and perhaps the U.S. Pacific Northwest.

North Korea says the missile could carry a large nuclear warhead.

The missile test is a direct challenge to U.S. President Donald Trump, who has vowed to prevent North Korea from being able to hit the United States with a nuclear missile.

He has frequently urged China to press the leaders of isolated North Korea to give up their nuclear program, and on Wednesday he denounced China’s trade with its defiant neighbor.

Chinese Foreign Ministry spokesman Geng Shuang, speaking in Beijing earlier on Thursday, said China fully implemented UN resolutions on North Korea.

As a neighbor, China had “normal” trade relations with North Korea and U.N. resolutions were clear that they were not intended to impact upon “livelihood and humanitarian needs”, he added.