Former U.K. Prime Minister David Cameron said Monday that President Donald Trump is right to adopt a tougher stance on China but warned that the president's tariff escalation is dangerous.

"Perhaps it is time for some tougher action, but I think there's risks involved in these tariff wars and there are dangers from them getting out of control," Cameron said on CNBC's "Closing Bell."

The U.S. and China are engaged in a long-running trade dispute, with each country placing tariffs on billions of dollars worth of imports.

While representatives of the world's two largest economies are set to resume trade talks on Oct. 10 in Washington, the back-and-forth tariff threats over the last 18 months have unsettled financial markets and caused concerns about a global recession.

Cameron said as prime minister he sought to establish a positive relationship with China "through opening up and through partnerships."

"China is rising, and we're not going to put a stop to that," said Cameron, who resigned as prime minister in 2016 after the U.K. voted to leave the European Union. "The question is: Can we make sure China rises safely?"

Even so, Cameron said he understood Trump's desire to crack down on China because he also has concerns about its behavior.

"There are abuses over copyright infringements and intellectual property and the like," Cameron said. China has been repeatedly accused of IP theft, allegations Beijing denies.

But Cameron cautioned Trump against further escalating the trade conflict through moves such as delisting Chinese stocks in the United States.

"I wouldn't advise it," Cameron said. "I think actually America benefits from Chinese companies coming to list here, just as Britain benefits from Chinese companies wanting to invest in Britain, grow in Britain and list on the London Stock Exchange."

White House trade advisor Peter Navarro told CNBC on Monday that recent reports that the U.S. is considering restrictions on Chinese companies are "fake news."