“China should acknowledge in an honest manner that the D.P.R.K. has just contributed to protecting peace and security of China, foiling the U.S. scheme for aggression by waging a hard fight in the front line of the showdown with the U.S. for more than seven decades, and thank the D.P.R.K. for it,” it said. “Some theorists of China are spouting a load of nonsense that the D.P.R.K.’s access to nukes strains the situation in Northeast Asia and offers the U.S. an excuse for beefing up its strategic assets in the region.”

In February, KCNA carried another commentary bitterly critical of China after Beijing announced that it was suspending all coal imports from North Korea for the rest of the year. But at the time, it did not mention China by name.

The commentary on Wednesday did not directly attack the government or the Communist Party of China, instead criticizing “commentaries” and “some ignorant politicians and media persons” in China. But it pointedly noted that these opinions were carried in publications “widely known as media speaking for the official stand of the Chinese party and government” and accused China of “insincerity and betrayal.”

In the North Korean state media, a commentary by an individual writer does not carry as much weight as an official government statement. But such bylined commentaries closely follow an official script, and the government in Pyongyang often uses them to voice its view indirectly.

Kim Chol’s commentary is the latest sign that North Korea fears China will acquiesce to American pressure for more vigorous sanctions enforcement, especially after Mr. Trump’s summit meeting last month with the Chinese president, Xi Jinping. Last month, The Associated Press reported from Pyongyang that drivers were scrambling to fill their tanks as gas stations began limiting services, an apparent response to reports that Beijing might use its oil supplies as leverage to force North Korea to stop developing nuclear weapons.

The KCNA commentary on Wednesday was the North’s most bitter and categorical criticism of China in recent memory, said Cheong Seong-chang, a longtime North Korea analyst at the Sejong Institute, a South Korean think tank.

“It has been a long-established tradition between North Korea and China that even if they held grudges against each other, they didn’t voice them in public,” Mr. Cheong said. “This shows that the current North Korea-China relations are bad enough for both sides to break that tradition.”