The head of China's representative office in Hong Kong said Thursday that his government supports the territory's leader remaining in office and called for cooler heads to prevail amid social unrest over a now-shelved extradition bill.

Wang Zhimin, director of the Central Government Liaison Office, said at a commemorative event that Chief Executive Carrie Lam's government should be given "time and space" to handle the months-long disputes over the amendment bill that could allow fugitives to be transferred to China.

"The Chinese government sternly supports Chief Executive Carrie Lam and the administration's continued effective ruling of Hong Kong in accordance with law," Wang said, adding that it also "supports the police in enforcing the law, maintaining social order and protecting safety of the people."

Wang was speaking out in public for the first time since millions of people took to the streets in recent weeks to protest against the bill they say could allow Chinese authorities to crack down on pro-democracy activists and critics of the Communist Party-led Beijing government.

Even though the government has made it clear that it will let the bill expire without action at the end of a legislative session in July next year, protests have continued, calling for its complete withdrawal and for Lam's resignation.

Some protesters stormed the Legislative Council on July 1 and ransacked its chamber, prompting the government to pledge to pursue those responsible for breaking into the building and vandalizing it.

"A growing number of citizens have learned from a string of violent incidents recently that tolerating illegal behavior or giving excuses to violent acts would present a blatant challenge to the spirit of rule of law in Hong Kong, damage the interests of all Hong Kong people at the end," Wang said.

"Effects on social wellbeing are starting to show that if disputes carry on in Hong Kong, problems and risks will only accumulate," he said, while urging all sectors to join together to build a better Hong Kong.

He went on to blast "some foreign forces" for interfering in Hong Kong's affairs and encouraged the whole society to "be on high alert and strongly oppose the extremely few people who become willing pawns of foreign forces in stirring up trouble...for their own interests."

Hong Kong media mogul and democracy advocate Jimmy Lai met with U.S. National Security Adviser John Bolton, Secretary of State Mike Pompeo and Vice President Mike Pence this week over the extradition bill, while singer-activist Denise Ho gave a speech at the U.N. Human Rights Council on suppression of rights and freedom in Hong Kong and called on it to eject China as a member.

In her latest bid to calm the situation, Lam reiterated on Tuesday that the bill "is dead" and apologized again for her failure in gauging public opinion. However, she insisted on staying in office and not withdrawing the bill as demanded by protesters.

Her tenure will end in 2022.

Related coverage:

Hong Kong leader declares controversial bill "dead"

IN PHOTOS: Hong Kong marches on