Hong Kong has been roiled by protests for more than two months. (File)

US President Donald Trump on Sunday warned China that carrying out a Tiananmen Square-style crackdown on Hong Kong pro-democracy protesters would harm trade talks between the two countries.

"I think it'd be very hard to deal if they do violence, I mean, if it's another Tiananmen Square," Trump told reporters in New Jersey. "I think it's a very hard thing to do if there's violence."

The months-long trade dispute between the US and China has been blamed for setting world financial markets on edge amid signs of a possible global economic slowdown.

Trump's comments came as Washington and Beijing look to revive pivotal high-level talks aimed at ending their trade war.

Phone calls between both countries' deputies are planned for the next 10 days, and if those are successful, negotiations between more senior officials could resume, Trump's chief economic advisor Larry Kudlow said on Sunday.

Hong Kong has meanwhile been rocked by more than two months of protests and on Sunday saw a crowd that organizers said numbered some 1.7 million people march peacefully in the city despite rising unrest and stark warnings from Beijing.

Last week, protesters paralyzed the city's airport, tarnishing a campaign that took pride in its peaceful intent and unpredictability -- which demonstrators have tagged with the slogan "Be Water."

Communist Party-ruled mainland China has in turn sharpened its tone towards the dissidents, decrying the "terrorist-like" actions of a violent minority, while state media has broadcast images of military personnel and armored personnel carriers in Shenzhen, across the border from the semi-autonomous city.

China deployed tanks to end student-led protests in the bloody 1989 crackdown in Beijing's Tiananmen Square, resulting in an estimated death toll between several hundred to over a thousand.

If such a situation was repeated in Hong Kong, "I think there'd be... tremendous political sentiment not to do something," Trump said, referring to the trade negotiations with China.

Creeping authoritarianism

Under a deal signed with Britain, China agreed to allow Hong Kong to keep its unique freedoms when the former crown colony was handed back in 1997.

But many Hong Kongers feel those freedoms are being chipped away, especially since China's hardline president Xi Jinping came to power.

Trump stopped short of endorsing the protesters, saying, "I'd love to see it worked out in a humane fashion," and calling on Xi to negotiate with the dissidents.

Last week, China's state-run daily The Global Times said there "won't be a repeat" of Tiananmen Square in a rare reference to the crackdown.

"China is much stronger and more mature, and its ability to manage complex situations has been greatly enhanced," the newspaper wrote in an editorial.

Analysts say any intervention in Hong Kong by Chinese security forces would be a disaster for China's reputation and economy.

The weeks of demonstrations have plunged the financial hub into crisis, with images of masked, black-clad protesters engulfed by tear gas during street battles against riot police stunning a city once renowned for its stability.

The unrest was sparked by widespread opposition to a plan for allowing extraditions to the Chinese mainland, but has since morphed into a broader movement for democratic rights in the semi-autonomous city.

Sunday's march, billed as a return to the peaceful origins of the leaderless protest movement, was one of the largest rallies since the protests began about three months ago, according to organizers the Civil Human Rights Front.