Donald Trump has shifted his stance on the unrest in Hong Kong in recent days to show greater solidarity with the pro-democracy protesters after coming to view the issue as a point of leverage in trade negotiations with China.

For months, Trump administration officials described the Hong Kong uprising as an internal matter for China, aware of how delicate the issue is for president Xi Jinping and other Communist Party officials.

With tensions already high between the two nations and trade talks stalled, the administration chose to tread lightly.

But as the protests have dragged on, advisers to Mr Trump have succeeded in making the case that wading into the issue could prove necessary — and advantageous — to the United States as it tries to push Beijing to accede to its trade terms.

After previously saying Hong Kong was a “very tough situation” that was up to Chinese leaders to handle, Mr Trump has more recently called on those leaders to offer a “humane” response and urged Xi to engage in dialogue with the protesters.

Continuing protests rock Hong Kong: In pictures Show all 35 1 /35 Continuing protests rock Hong Kong: In pictures Continuing protests rock Hong Kong: In pictures Police officers point their guns towards pro-democracy protesters after a clash at a march in Hong Kong on August 25 Reuters Continuing protests rock Hong Kong: In pictures Pro-democracy protesters throw molotov cocktails during clashes with riot police in Hong Kong on August 25 Reuters Continuing protests rock Hong Kong: In pictures Demonstrators rally behind barricades ass they are shrouded in tear gas deployed by police in Hong Kong on August 25 Reuters Continuing protests rock Hong Kong: In pictures Police clash withpro-democracy protesters at a march in Hong Kong on August 25 Reuters Continuing protests rock Hong Kong: In pictures A police officer prepares to strike a protester as clashes erupt during a pro-democracy march in Hong Kong on August 24 AFP/Getty Continuing protests rock Hong Kong: In pictures A water cannon is fired by riot police to clear the street of demonstrators during a protest in Hong Kong on August 25 EPA Continuing protests rock Hong Kong: In pictures Pro-democracy protesters use a slingshot during clashes with riot police in Hong Kong on August 25 Reuters Continuing protests rock Hong Kong: In pictures Riot police fire tear gas to disperse pro-democracy protesters in Hong Kong on August 24 Reuters Continuing protests rock Hong Kong: In pictures A demonstrator throws a molotov cocktail as they clash with riot police during a protest in Hong Kong on August 25 Reuters Continuing protests rock Hong Kong: In pictures A demonstrator swings a tennis racket in an attempt to knock back a tear gas cannister thrown by riot police during a protest in Hong Kong on August 25 Reuters Continuing protests rock Hong Kong: In pictures A protester displays a Hong Kong Independence flag during a pro-democracy march in Hong Kong on August 24 EPA Continuing protests rock Hong Kong: In pictures Riot police tend to a detained demonstrator who has been injured during a protest in Hong Kong on August 25 Reuters Continuing protests rock Hong Kong: In pictures A demonstrator uses bamboo poles to build a barricade during a protest in Hong Kong on August 25 Reuters Continuing protests rock Hong Kong: In pictures Riot police clash with demonstrators during a protest in Hong Kong on August 24 Reuters Continuing protests rock Hong Kong: In pictures Protesters are hit by tear gas fired by the police in Hong Kong on August 24 AFP/Getty Continuing protests rock Hong Kong: In pictures Demonstrators shrouded in tear gas shield themselves behind barricades during a clash with riot police in Hong Kong on August 25 Getty Continuing protests rock Hong Kong: In pictures Riot police arrest a protester during a pro-democracy march in Hong Kong on August 24 EPA Continuing protests rock Hong Kong: In pictures Police clash with pro-democracy protesters at the Hong Kong international airport on August 13 AFP/Getty Continuing protests rock Hong Kong: In pictures Protesters fall back as they clash with police during a protest at Kowloon Bay in Hong Kong on August 24 AFP/Getty Continuing protests rock Hong Kong: In pictures Police clash with pro-democracy protesters at the Hong Kong international airport on August 13 Reuters Continuing protests rock Hong Kong: In pictures Riot police move to disperse protesters during a clash at the Hong Kong international airport on August 13 Reuters Continuing protests rock Hong Kong: In pictures Commuters riding in a bus drive past protesters in Hong Kong's Kowloon Bay on August 24 AFP/Getty Continuing protests rock Hong Kong: In pictures Protester hold umbrellas as they take part in a pro-democracy march in Hong Kong on August 24 EPA Continuing protests rock Hong Kong: In pictures Riot police detain a demonstrator as they clash during a protest in Hong Kong on August 24 Reuters Continuing protests rock Hong Kong: In pictures Pro-democracy protesters block the entrance to the airport terminals after clashes with police at the Hong Kong international airport on August 13 AFP/Getty Continuing protests rock Hong Kong: In pictures Riot police spray pepper spray as shield themselves by a police van during a clash with pro-democracy protesters at the Hong Kong international airport on August 13 Reuters Continuing protests rock Hong Kong: In pictures Riot police use pepper spray to disperse protesters during a demonstration at the Hong Kong international airport on August 13 Reuters Continuing protests rock Hong Kong: In pictures Demonstrators shrouded in tear gas shield themselves behind barricades during a clash with riot police in Hong Kong on August 25 Reuters Continuing protests rock Hong Kong: In pictures Medical professionals gather to protest police brutality at the Queen Elizabeth Hospital in Hong Kong on August 13 Getty Images Continuing protests rock Hong Kong: In pictures Police detain a pro-democracy protester at the Hong Kong international airport on August 13 AFP/Getty Continuing protests rock Hong Kong: In pictures A protester is halted by police during an occupation at the Hong Kong international airport on August 13 AP Continuing protests rock Hong Kong: In pictures Police clash with pro-democracy protesters at the Hong Kong international airport on August 13 AFP/Getty Continuing protests rock Hong Kong: In pictures Police stand guard at the entrance of the departure terminals at the Hong Kong international airport on August 13 AFP/Getty Continuing protests rock Hong Kong: In pictures Protesters continue their occupation at the Hong Kong international airport on August 14 AP Continuing protests rock Hong Kong: In pictures Travellers read placards and posters left by pro-democracy protesters at the Hong Kong international airport on August 14 AP

The change in the administration’s tone appeared to be carefully coordinated this week, after Mr Trump issued a warning to China on Sunday.

The words were couched in practical terms centred on a trade deal, not in the language of human rights, but they were nevertheless surprising given Mr Trump’s earlier passive remarks on Hong Kong.

“I think it would be very hard to deal if they do violence,” Mr Trump said on Sunday. “I mean, if it’s another Tiananmen Square, it’s — I think it’s a very hard thing to do if there’s violence.”

The next day, US vice president Mike Pence echoed those words in a speech in Detroit.

“It will be much harder for us to make a deal if something violent happens in Hong Kong,” he said. “And I want to assure you, our administration will continue to urge Beijing to act in a humanitarian manner and urge China and the demonstrators in Hong Kong to resolve their differences peaceably.”

US secretary of state Mike Pompeo was even more explicit in tying Hong Kong to trade in an interview with Fox News on Monday. He accused China of violating promises it made to Hong Kong and commitments about protecting human rights.

“When we try to negotiate a trade agreement with them,” Mr Pompeo said, “we’ve tried to put in processes that ensure we have the opportunity to verify because we need to make sure that we don’t suffer from China breaking a promise or have to watch Chinese disinformation about the agreement that’s entered into.”

By conveying the belief that China is straying from its decades-old commitment to preserve Hong Kong’s independent political system, the top American officials are buttressing their argument that a trade treaty with China must have strict enforcement provisions.

They are also sending the message that a violent crackdown in Hong Kong along the lines of the 1989 Tiananmen Square massacre would make China a pariah in the eyes of many Americans and other citizens around the world, rendering it all but impossible to resume trade discussions amid the global backlash.

Trump muses about serving more than two terms as president

“Showing support for a peaceful resolution of the situation in Hong Kong could potentially give the US a stronger hand in trade negotiations under the assumptions that Beijing wants a trade deal badly enough and wants to maintain Hong Kong’s special status in its trade with the US,” said Eswar Prasad, the former head of the International Monetary Fund’s China division.

“Both are reasonable assumptions but might be trumped by Beijing’s unwillingness to countenance further protests in Hong Kong that directly challenge Beijing’s authority.”

Foreign policy officials have grappled in recent weeks with how to get Mr Trump to take a more forceful stand on Hong Kong.

Officials are wary of potentially harsh measures Xi might take against the protesters. They have become more concerned as videos have emerged of Chinese troops massing across the border in Shenzhen.

Several top aides had urged Mr Trump to make statements warning the Chinese leadership against using violence.

Among them is John Bolton, the national security adviser, who views China as a formidable rival. Mr Trump, on the other hand, said in June that he saw the United States and China as “strategic partners”.

Donald Trump says 'I am the chosen one' in tirade over looming recession and China trade war

US officials are also cognisant that they must avoid giving the Communist Party ammunition that it can use to reinforce its conspiratorial message that the United States and other western powers are “black hands” behind the protests.

As a trade deal has appeared increasingly remote, Mr Bolton and other China hawks in the administration have pushed Mr Trump to move ahead on separate issues that advisers feared might jeopardise the trade talks.

That includes the sale of 66 F-16 fighter jets to the self-governing island of Taiwan. The $8bn (£6.5bn) deal is the largest or one of the largest arms sales from the United States to Taiwan.

Lawmakers had accused the Trump administration of delaying the sale to avoid upsetting the trade talks.

But last week, Mr Bolton, who advocates greater American support for Taiwan, prodded Mr Trump to go ahead with the sale.

Mr Pompeo signed a memo approving the deal on 15 August and the administration gave formal notification to Congress on Tuesday.

Yet the administration has failed to take action on what is by far the biggest human rights abuse by China in decades — the detention of 1 million or more Muslims.

Mr Bolton, Mr Pompeo and other foreign policy aides have recommended to Mr Trump that the United States impose sanctions on Chinese officials over the detentions.

Military vehicles seen in Shenzhen near Hong Kong border

Trade advisers such as treasury secretary Steven Mnuchin have argued that the sanctions would endanger trade talks. In an interview in June, Mr Mnuchin would not comment on the detentions of Muslims.

Human rights advocates say they hope the recent appointment of a Uighur-American scholar, Elnigar Iltebir, to the National Security Council will lead to action. Most of the detained Muslims are ethnic Uighurs.

Some analysts are sceptical of the new linkages among trade, human rights and Hong Kong that the administration is pushing.

Given Mr Trump’s vacillations on many issues, “would such a threat be credible to Xi?” said Susan Shirk, the chair of the University of California at San Diego’s 21st Century China Centre.

Others warn the moves could backfire.

“The US government has to be careful not to do things that could be portrayed as inciting riots,” said Michael Pillsbury, a China expert at the Hudson Institute and an informal adviser to the president.

“What the Trump assessment team in Beijing is trying to figure out is the grand strategy. Is Trump trying to overthrow the party, or is it just about trade?”