Russia and China called for restraint on Monday after US President Donald Trump warned over the weekend that “only one thing will work” in dealing with North Korea, suggesting that military action is on his mind.

“Moscow has called and continues to call on the parties involved in the conflict and on those who have anything to do with this issue to exercise restraint and to avoid any steps that would only worsen the situation,” Kremlin spokesman Dmitry Peskov told reporters on a conference call in response to a question about Trump’s comment.

In Beijing, Chinese Foreign Ministry spokeswoman Hua Chunying repeated China’s position that all parties exercise restraint, describing the situation as extremely complex and serious.

Trump repeatedly has made clear his distaste for dialogue with North Korea. Last week, he dismissed the idea of talks as a waste of time, a day after Secretary of State Rex Tillerson said Washington was maintaining open lines of communication with North Korean leader Kim Jong Un’s government.

“Our country has been unsuccessfully dealing with North Korea for 25 years, giving billions of dollars & getting nothing. Policy didn’t work!” Trump said in a Twitter post on Monday.

In recent weeks, North Korea has launched two missiles over Japan and conducted its sixth nuclear test, all in defiance of UN Security Council resolutions. Pyongyang has said its goal is to develop a nuclear-tipped missile capable of hitting the US mainland.

US Defense Secretary Jim Mattis on Monday said the US Army has to be ready with military options on North Korea, but emphasized that efforts to deal with Pyongyang were being led diplomatically.

“There is one thing the US Army can do and that is you have got to be ready to ensure that we have military options that our President can employ if needed,” Mattis said in a speech at an annual US Army conference.

“We currently are in a diplomatically led effort and how many times have you seen the UN Security Council vote unanimously, now twice in a row, to impose stronger sanctions on North Korea,” Mattis said.

Separately, the US Navy’s Theodore Roosevelt Carrier Strike Group left San Diego on Friday for a scheduled deployment to the western Pacific and the Middle East.

A second US carrier, the Japan-based USS Ronald Reagan, departed Hong Kong on October 8 after a port visit. The Reagan and its escorting warships are heading for Korean waters to participate in scheduled US-South Korean naval maneuvers around October 15.