The US president has piled pressure on China to use its diplomatic and economic clout over North Korea, its Communist ally, to persuade Pyongyang to stop its nuclear and missile activities.
China's foreign ministry spokesman Geng Shuang told a press briefing that its contribution was well recognised describing its role as 'indispensable' after Trump called on China to take more action on North Korea.
"Perhaps China will put a heavy move on North Korea and end this nonsense once and for all!" tweeted Trump, who will meet with Chinese President Xi Jinping at the G20 summit in Germany later this week.
"China has made relentless efforts for the settlement of the Korean peninsula nuclear issue. China's contribution in this regard is well recognised, and its role is indispensable," Geng said.
Geng said China was following developments closely after North Korean television announced that leader Kim Jong-Un had overseen the 'landmark' test of a Hwasong-14 missile, which reached an altitude of 2,802 kilometres (1,741 miles) and flew 933 kilometres.
"China opposes the DPRK breaching UN Security Council resolutions to conduct launch activities," the spokesman said, using the initials of North Korea's official name.
"We hope all relevant parties can exercise restraint, avoid taking actions that may escalate tensions, and make efforts to bring the issue back to peaceful settlement through dialogue and consultation," Geng said.
On a trip to Moscow, Chinese President Xi Jinping and Russian counterpart Vladimir Putin agreed on Monday to "jointly push for a proper settlement of the (Korean) peninsula issue via dialogue and negotiation", according to the official Xinhua news agency.
China's response to Trump's tweet comes as tensions between the superpowers have resurfaced in recent days, breaking from a friendlier atmosphere that emerged after Trump met Xi at the US leader's Florida resort in April.
Trump warned about 'the growing threat' posed by North Korea during a phone call with Xi on Monday, while the Chinese leader said Sino-US relations were hit by 'negative factors'.
China announced in February the suspension of coal imports from North Korea for the rest of the year, a crucial currency earner for Pyongyang.
The total value of all imports from North Korea fell to $721.5 million between January and May from $773.6 million over the same period last year, according to Chinese official figures.
But Trump has urged Beijing to do more and last week his administration took steps that infuriated the Asian superpower.
The US Treasury Department slapped sanctions on China's Bank of Dandong for allegedly laundering North Korean cash and it accused a Chinese shipping company of smuggling banned luxury goods into the country.
The Trump administration also authorised a $1.3 billion arms sales to Taiwan and placed China on a list of the world's worst human trafficking offenders.
China has pressed for the resumption of six-party negotiations with North Korea that have been dormant since 2009.
Beijing proposes a 'dual-track approach' in which Pyongyang would suspend its nuclear and missile activities while the United States and South Korea would halt large-scale military exercises.
(Except for the headline, this story has not been edited by NDTV staff and is published from a syndicated feed.)