Beijing should be grateful to Pyongyang for its protection, said a bylined commentary carried by the Korean Central News Agency (KCNA), warning of "grave consequences" if China tests its patience further.
China's Global Times newspaper retorted that the nuclear-armed North was in the grip of "some form of irrational logic" over its weapons programmes.
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 rival texts are a sign of the level to which ties between the two have deteriorated. KCNA regularly carries vivid denunciations of the US, Japan, and the South Korean authorities, but it is rare for it to turn its ire on China.
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 programmes.
The KCNA commentary denounced the People's Daily, the official mouthpiece of the Chinese Communist party, and the Global Times, which sometimes reflects the thinking of the leadership, as having "raised lame excuses for the base acts of dancing to the tune of the US".
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, bylined "Kim Chol" -- believed to be a pseudonym.
"The DPRK will never beg for the maintenance of friendship with China, risking its nuclear programme 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 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".
"Pyongyang obviously is grappling with some form of irrational logic over its nuclear programme," it added.
Beijing "should also make Pyongyang aware that it will react in unprecedented fashion if Pyongyang conducts another nuclear test", it said.
"The more editorials KCNA publishes, the better Chinese society will be able to understand how Pyongyang thinks, and how hard it is to solve this nuclear issue," the Global Times said.
Washington is meanwhile pushing Beijing -- which says its influence is less than believed -- to put more pressure on Pyongyang.
US Secretary of State Rex Tillerson last week warned the UN Security Council of "catastrophic consequences" if the international community -- most notably China -- failed to pressure the North into abandoning its weapons programme.
Chinese Foreign Minister Wang Yi brushed aside Tillerson's comments, saying that "the key to solving the nuclear issue on the peninsula does not lie in the hands of the Chinese side".
(Except for the headline, this story has not been edited by NDTV staff and is published from a syndicated feed.)