Donald Trump has said he is sure China and Hong Kong “will be able to work it out” as the international community has called for protesters’ rights to be respected and demonstrators vowed not to retreat over their calls for the extradition bill to be scrapped.

On Wednesday police used used rubber bullets, batons and teargas against people in Hong Kong protesting against the bill that would tighten Beijing’s grip on the semi-autonomous territory.

The US president, who is engaged in a major trade war with Beijing, said he hoped the protesters could “work it out” with Beijing. “I understand the reason for the demonstration, but I’m sure they will be able to work it out.” He did not say how he thought the issue would be resolved.

Quick Guide What are the Hong Kong protests about? Show Why are people protesting? The protests were triggered by a controversial bill that would have allowed extraditions to mainland China, where the Communist party controls the courts, but have since evolved into a broader pro-democracy movement. Public anger – fuelled by the aggressive tactics used by the police against demonstrators – has collided with years of frustration over worsening inequality and the cost of living in one of the world's most expensive, densely populated cities. The protest movement was given fresh impetus on 21 July when gangs of men attacked protesters and commuters at a mass transit station – while authorities seemingly did little to intervene. Underlying the movement is a push for full democracy in the city, whose leader is chosen by a committee dominated by a pro-Beijing establishment rather than by direct elections.

Protesters have vowed to keep their movement going until their core demands are met, such as the resignation of the city’s leader, Carrie Lam, an independent inquiry into police tactics, an amnesty for those arrested and a permanent withdrawal of the bill. Lam announced on 4 September that she was withdrawing the bill. Why were people so angry about the extradition bill? Beijing’s influence over Hong Kong has grown in recent years, as activists have been jailed and pro-democracy lawmakers disqualified from running or holding office. Independent booksellers have disappeared from the city, before reappearing in mainland China facing charges. Under the terms of the agreement by which the former British colony was returned to Chinese control in 1997, the semi-autonomous region was meant to maintain a “high degree of autonomy” through an independent judiciary, a free press and an open market economy, a framework known as “one country, two systems”. The extradition bill was seen as an attempt to undermine this and to give Beijing the ability to try pro-democracy activists under the judicial system of the mainland. How have the authorities responded? Beijing has issued increasingly shrill condemnations but has left it to the city's semi-autonomous government to deal with the situation. Meanwhile police have violently clashed directly with protesters, repeatedly firing teargas and rubber bullets. Beijing has ramped up its accusations that foreign countries are “fanning the fire” of unrest in the city. China’s top diplomat Yang Jiechi has ordered the US to “immediately stop interfering in Hong Kong affairs in any form”. Lily Kuo and Verna Yu in Hong Kong

Speaking at the White House, Trump said the demonstrations were massive. “That was a million people. That was as big a demonstration as I’ve ever seen,” he said.

“So, I hope it all works out for China and for Hong Kong,” Trump added. “I understand the reason for the demonstration but I’m sure they will be able to work it out. I hope they’re going to be able to work it out with China.”

The European Union said rights “need to be respected” in Hong Kong. “Over the past days, the people of Hong Kong have exercised their fundamental right to assemble and express themselves freely and peacefully. These rights need to be respected,” the EU’s external affairs ministry statement said.

“Restraint should be exercised by all sides; violence and escalatory responses must be avoided,” it added.

Thousands of protesters occupied the roads near the Legislative Council Complex in Hong Kong on Wednesday. Photograph: Chan Long Hei/SOPA Images/REX/Shutterstock

The outgoing British prime minister, Theresa May, called for the rights and freedoms set out in the 1984 Sino-British agreement on Hong Kong’s future to be respected.

“It is vital that those extradition arrangements in Hong Kong are in line with the rights and freedoms that were set down in the Sino-British joint declaration,” May told parliament in London.

The British foreign secretary, Jeremy Hunt, echoed her words, urging the Hong Kong government to “listen to the concerns of its people and its friends in the international community and to pause and reflect on these controversial measures”.

“It is essential that the authorities engage in meaningful dialogue and take steps to preserve Hong Kong’s rights and freedoms and high degree of autonomy, which underpin its international reputation,” Hunt said.

US Representative James McGovern, a Democrat, said he and Republican co-sponsors planned to put forward legislation on Wednesday or Thursday that would likely raise the standard for determining whether Hong Kong was sufficiently autonomous to receive special treatment from the US on trade and economics.

“The president should look at the reaction in Congress,” McGovern said. “There is bipartisan outrage over what is happening ... peaceful protesters being met with terrible violence by Hong Kong security forces. It’s unacceptable.”

The Australian government raised concerns about the proposed amendments to the extradition laws and supported the right to peaceful protest and urged restraint on all sides.

Foreign affairs minister Marise Payne said: “The Australian government believes it is important that any changes to Hong Kong’s extradition arrangements are ... resolved in a way that fully respects Hong Kong’s high degree of autonomy and upholds the rights and freedoms enshrined in Hong Kon’g Basic Law under the ‘one country, two systems’ framework.”

On Wednesday, Hong Kong’s leader, chief executive Carrie Lam, called the protests “dangerous and life threatening acts”. She noted that some young people in the crowd had expressed their views peacefully, but said the protest had devolved into a “blatant, organised riot”.

Taiwan’s prime minister, Tsai Ing-wen, said her nation supported the protesters. “You may feel your demands for freedom seem to fall on deaf ears, please know that all like-minded friends in #Taiwan & around the world are standing with you,” she tweeted.