NORTH Korea has blasted ally China in a stinging critique and said the Asian powerhouse should be grateful to Pyongyang for its protection.
The rare and stinging critique, in Pyongyang's state media, lashed out at its main diplomatic protector and economic benefactor.
The article also warned of "grave consequences" if North Korea's patience is tested further.
But Beijing offered a measured response to a signed commentary carried by the Korean Central News Agency.
China's Global Times newspaper retorted that the nuclear-armed North was in the grip of "some form of irrational logic" over its weapons programs.
Chinese foreign ministry spokesman Geng Shuang took a conciliatory tone when asked about KCNA's commentary at a press briefing, saying Beijing has a consistent position of "developing good neighbourly and friendly co-operation" with North Korea.
He also said China was "firmly committed" to the denuclearisation of the Korean peninsula through dialogue and consultation.
Beijing and Pyongyang have a relationship forged in the blood of the Korean War, and the Asian giant remains its wayward neighbour's main provider of aid and trade.
But ties have begun to fray in recent years, with China increasingly exasperated by the North's nuclear antics and fearful of a regional crisis. North Korean leader Kim Jong-un has yet to visit Beijing, more than five years after taking power.
The media spat is a sign of the level to which ties between the two have deteriorated.
Beijing regularly calls for parties to avoid raising tensions - remarks that can apply to both Washington and Pyongyang - and in February it announced the suspension of coal imports from the North for the rest of the year, a crucial foreign currency earner for the authorities.
Chinese state-run media have called for harsher sanctions against the North in the event of a fresh atomic test, urged Pyongyang to "avoid making mistakes", and spoken of the need for it to abandon its nuclear programs.
Chinese suggestions that the North give up its weapons crossed a "red line" and were "ego-driven theory based on big-power chauvinism" said the article, byline "Kim Chol", believed to be a pseudonym.
"The DPRK will never beg for the maintenance of friendship with China, risking its nuclear program which is as precious as its own life," it said, referring to the North by its official name, the Democratic People's Republic of Korea.
Pyongyang had acted as a buffer between Beijing and Washington since the Korean War in the 1950s and "contributed to protecting peace and security of China", it said, adding that its ally should "thank the DPRK for it".
Beijing should not try to test the limits of the North's patience, it said, warning: "China had better ponder over the grave consequences to be entailed by its reckless act of chopping down the pillar of the DPRK-China relations."
In its response on Thursday, the Global Times - which can sometimes stridently espouse what it sees as China's interests - dismissed the KCNA article as "nothing more than a hyper-aggressive piece completely filled with nationalistic passion".
Update your news preferences and get the latest news delivered to your inbox.