An Iranian man holds a local newspaper displaying a portrait of Donald Trump a day after his election as the new US president, in the capital Tehran, on November 10, 2016.

The U.S. won't just hurt its own credibility if it pulls out of the Iran nuclear deal, it will also make it more difficult to pursue dialogue with North Korea, Chinese state media said in an editorial published on Friday morning.

President Donald Trump said Tuesday at the U.N. General Assembly that the 2015 nuclear deal with Iran was an "embarrassment" and the "worst ever." He has been critical of the Iran deal since his presidential campaign.

If Washington dumps an Iran deal which is already delivering on its aims, it would not just be an embarrassment for the U.S. and "belie the U.S.'s self-touted commitment to a rule-based international order," it will also send a signal that even if Pyongyang was willing to come to the discussion table, "the U.S. could not be trusted to honor any deal that was reached," the state-owned China Daily said in its commentary.

Chinese media editorials can offer insights into the mainland government's thinking.

The editorial follows Chinese foreign minister Wang Yi's comment on state radio on Thursday that recent tensions on the Korean Peninsula underlined the importance of the Iranian nuclear deal, Reuters reported.

"Pulling the U.S. out of the deal would not only erode the credibility of the U.S. It would also deal a heavy blow to the international nuclear non-proliferation drive, and set a bad precedent that would surely hamper the ongoing multinational efforts at finding a peaceful solution to the Korean Peninsula nuclear deadlock through negotiations," said China Daily.

The 2015 agreement, known as the Joint Comprehensive Plan of Action, was signed by Iran, the United States, France, China, Russia, the United Kingdom, Germany and the European Union. Proponents of the agreement argue it's the best way to keep Iran from becoming a nuclear-armed nation, at least until the sunset provision on the deal expires in eight years.

Under a law passed by Congress, the president must certify every 90 days whether Iran remains in compliance with the landmark, 2015 pact, which eased severe economic sanctions on Iran in exchange for the country freezing its nuclear activities. NBC reported Wednesday that Trump is leaning toward decertifying the agreement.

Trump has taken issue with the deal, which was inked during Barack Obama's time in office, with the new administration citing concerns over Iran's ballistic missile program and accusing Iran of supporting terrorism.

However, Iran has been "in technical compliance" with the agreement, China Daily said.

Trump is also reportedly unhappy with the so-called "sunset clauses," which allow Iran to resume some nuclear enrichment from 2025.

"But he forgets that diplomacy is an art that involves give and take, and the deal is a bargain that could not have been struck with a win-it-all mindset," said China Daily.

"In his speech, Trump called on all nations to respect the rights of other nations. He should put those words into practice. Other nations have the right to expect the U.S. to honor the agreements it has made. As U.S. president, Trump should respect that right," added the newspaper.

Read China Daily's editorial on Trump's comment about the Iran nuclear deal at the UN.

—CNBC's Jason Gewirtz contributed to this article.