Donald Trump told Chinese president Xi Jinping last month that the US would tone down criticism of Beijing’s approach to Hong Kong following massive protests in the territory in order to revive trade talks with China.

The US president made the commitment when the two leaders met at the G20 summit in Osaka, according to several people familiar with the meeting. One person said Mr Trump made a similar pledge in a phone call with Mr Xi ahead of the G20 summit.

The White House and state department declined to comment.

Following the Trump-Xi meeting, the state department told Kurt Tong, the departing US consul general in Hong Kong, to remove several critical comments about China from his final speech in the Asian financial hub. Mr Tong had told people he would give a speech about Hong Kong that would mention the erosion of freedoms by China in the territory, but the veteran diplomat was forced to water down the July 2 address.

Hong Kong has been ruled under a “one country, two systems” formula since the UK handover of the territory to China in 1997. But critics say Beijing has taken a heavier hand towards affairs in Hong Kong in recent years, diluting freedoms in the territory.

Over the past month, millions of people have taken to the streets to protest an extradition bill that if passed would have allowed suspected criminals to be sent from the city to mainland China for the first time. Carrie Lam, Hong Kong’s chief executive, suspended the proposed law but has rebuffed demands to withdraw it completely.

US officials have expressed support for the protesters but Mr Trump has faced criticism for saying relatively little. Mike Pompeo, secretary of state, last month denied that the president was taking a soft approach on human rights to help facilitate a trade deal. He told Fox News ahead of the G20 that Mr Trump was a “vigorous defender of human rights” and that Hong Kong would probably be discussed at the Osaka meeting.

Mr Trump said in a news conference at the G20 that the US and China had agreed to resurrect trade negotiations following an “excellent” meeting with Mr Xi. Last week, he said he had discussed Hong Kong “briefly” with the Chinese leader. Asked if he had a message for the protesters, Mr Trump said they were “looking for democracy” and, without naming China, added that “unfortunately some governments don’t want democracy”.

Dennis Wilder, a former White House Asia official, said Mr Trump’s willingness to ease criticism of China’s Hong Kong policy was “consistent with his singular focus on the economic issues in bilateral relations with China”. He added that the president had “consistently dampened down the tougher edges of US policy on China” on a range of issues, including “criticism of China’s human rights record in Xinjiang”, which was “frustrating the China hawks within his administration”.

Mr Tong, who retires on Friday, was also due to give a talk at the Center for Strategic and International Studies, a think-tank, in Washington on Wednesday. But the speech was postponed at short notice, leading some to say privately that the state department had instructed him to push back the address.

One person familiar with talks at CSIS said the Trump administration was more aggressive about policing officials than its predecessors. “Our speakers from state and defence get pulled or told they can’t take questions or do things on the record about half the time these days — usually at the last minute,” he said.

A senior state department official pushed back against suggestions that Mr Tong had been censored, saying the speech was not cancelled but postponed to provide enough time for officials to ensure planning and co-ordination.

Under the 1992 Hong Kong Policy Act, the US allows Hong Kong to be treated as a non-sovereign entity distinct from China on trade and economic matters. The US previously warned that the extradition bill put that special status at risk. But Ho-Fung Hung, a China expert at Johns Hopkins University, said Mr Trump wants a trade deal with China and “sees Hong Kong as just one of his bargaining chips”.

Anson Chan, the former head of Hong Kong’s civil service, said the city expected the US to hold China accountable for its treaty obligations towards the territory, adding that this should be of equal interest to Washington.

“Hong Kong remains the beacon of hope for a more liberal, open and tolerant China and if full democracy, including one man one vote, takes root in Hong Kong, then this place will serve as a useful testing ground for the introduction of democracy in the mainland,” she said.

On Monday Mike Pence, US vice-president, and Mr Pompeo met Jimmy Lai, a pro-democracy publisher from Hong Kong, in a move that was condemned by Beijing. The Chinese foreign ministry said the US had “time and again interfered with Hong Kong affairs, which are China’s domestic affairs”.

Follow Demetri Sevastopulo and Sue-Lin Wong on Twitter: @dimi and @suelinwong