BEIJING (Reuters) - If North Korea launches an attack that threatens the United States then China should stay neutral, but if the United States attacks first and tries to overthrow North Korea’s government China will stop them, a Chinese state-run newspaper said on Friday.

FILE PHOTO: Members of honour guards hold red flags during a welcoming ceremony for Denmark's Queen Margrethe II outside the Great Hall of the People in Beijing April 24, 2014. REUTERS/Jason Lee

President Donald Trump ratcheted up his rhetoric toward North Korea and its leader on Thursday, warning Pyongyang against attacking Guam or U.S. allies after it disclosed plans to fire missiles over Japan to land near the U.S. Pacific territory.

China, North Korea’s most important ally and trading partner, has reiterated calls for calm during the current crisis. It has expressed frustration with both Pyongyang’s repeated nuclear and missile tests and with behavior from South Korea and the United States that it sees as escalating tensions.

The widely read state-run Global Times, published by the ruling Communist Party’s official People’s Daily, wrote in an editorial that Beijing is not able to persuade either Washington or Pyongyang to back down.

“It needs to make clear its stance to all sides and make them understand that when their actions jeopardize China’s interests, China will respond with a firm hand,” said the paper, which does not represent government policy.

“China should also make clear that if North Korea launches missiles that threaten U.S. soil first and the U.S. retaliates, China will stay neutral,” it added.

“If the U.S. and South Korea carry out strikes and try to overthrow the North Korean regime and change the political pattern of the Korean Peninsula, China will prevent them from doing so.”

China has long worried that any conflict on the Korean peninsula, or a repeat of the 1950-53 Korean war, could unleash a wave of destabilizing refugees into its northeast, and could end up with a reunified county allied with the United States.

North Korea is a useful buffer state for China between it and U.S. forces based in South Korea, and also across the sea in Japan.

The Global Times said China will “firmly resist any side which wants to change the status quo of the areas where China’s interests are concerned”.

“The Korean Peninsula is where the strategic interests of all sides converge, and no side should try to be the absolute dominator of the region.”

(Story refiles to correct typographical error to “them”, not “then”, paragraph 1.)