An editorial in the state-run Global Times revealed that if the US strikes first, China will side with North Korea and aim to ‘prevent’ any attack.
However, it will remain neutral in the conflict if North Korea launches an attack that threatens US soil.
It comes amid increasing tensions between the two countries, with US president Donald Trump admitting that his ‘fire and fury’ warning to Kim may not have been tough enough.
Fears of a nuclear attack from either side has prompted China to weigh in on the saga to clarify its position.
The Global Times said: ‘China should also make clear that if North Korea launches missiles that threaten US soil first and the US retaliates, China will stay neutral.
‘If the US 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 opposes both nuclear proliferation and war in the Korean Peninsula. It will not encourage any side to stir up military conflict, and will firmly resist any side which wants to change the status quo of the areas where China’s interests are concerned.’
For some years, China has been North Korea’s most significant ally and trading partner, a role that has been made even important by strict economic sanctions imposed on North Korea by the UN.
Trump says 'fire and fury' if any North Korean action
It has issued several calls for calm as the war of words between Kim and Trump continues to escalate.
Pyongyang has said it plans to launch a nuclear strike in the US territory of Guam.
But Trump has warned Kim to stand down, telling him that his country will ‘be met with fire and fury like the world has never seen’.
The president has since doubled down on the claim, admitting it might not have been tough enough and North Korea should be ‘very, very nervous’.