Hong Kong police have fired teargas at demonstrators and moved to disperse crowds after protesters stormed the legislative council building and raised the territory’s former colonial flag on the 22nd anniversary of its handover to China.

The dramatic scenes came after a peaceful march of half a million people made its way through other parts of the city as its deepest political crisis in two decades showed no sign of abating. For the past month protesters have been demanding the withdrawal of a bill that would allow extraditions to the Chinese mainland as anger has grown against Hong Kong authorities and the territory’s chief executive, Carrie Lam.

'They will definitely take revenge': how China could respond to the Hong Kong protests Read more

The police action came against a breakaway group of protesters, some of whom had forced their way into the legislative council building and vandalised its main chamber.

Shortly after midnight local time (1600 BST), police in riot gear held up a black flag reading “teargas warning” before shooting several rounds of the gas into protesters. They then climbed over barricades put up by protesters earlier in the day and charged at the people gathered.

Outside the legislative council building protesters wearing hard hats, goggles and masks ran away clutching umbrellas as smoke filled the air.

Protesters had for hours been repeatedly striking reinforced glass walls with a metal trolley and poles as hundreds of others watched on. Once inside they threw chairs and tore down and defaced portraits of past lawmakers. After the protesters were dispersed, images of the vandalised building were broadcast. More than 50 people were reportedly taken to hospital for treatment after various protests throughout the day.

Quick guide What are the Hong Kong protests about? Show Hide 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

“I don’t know whether this would work, but what other channels are there to make Carrie Lam listen to us?” said a male protester outside the legislative council building, who declined to be named.

“We used to protest peacefully but it didn’t work, now we need to get out of this framework and tell them, we’re willing to try anything until you give us an answer.”

Police had issued several warnings through the evening and appeared to be gearing up for violent clashes, but had left the protesters largely unhindered in their efforts even as the group tore up the inside of the building. Local TV footage showed police officers armed with non-lethal weaponry in other parts of the government complex as the protesters broke in.

One lawmaker, Fernando Cheung, suggested to reporters that the inaction from police had been a trap, aimed at swinging public sentiment against the protest movement with the help of violent and destructive scenes.

Facebook Twitter Pinterest Riot police outside the legislative council building. Photograph: Thomas Peter/Reuters

Half a dozen pro-democracy and independent lawmakers had earlier scuffled with protesters as they called for calm and pushed against the trolley that was being used to enter the council building.

“They simply wouldn’t listen to me,” said Lam Cheuk-ting, one of the politicians. “The movement at large is peaceful, but some young people are overwhelmed by a strong sense of helplessness and they’re emotionally charged.”

While a small splinter group was causing trouble at the legislature, 550,000 people marched peacefully through downtown Hong Kong without any scenes of violence or chaos.

The organisers of that rally – the Civil Human Rights Front (CHRF) – issued a joint statement with democratic lawmakers placing the blame for the destruction at the legislative council squarely on Lam, saying she had “ignored the demands of the people and pushed youngsters towards desperation”.

The CHRF also reiterated its five demands: the full retraction of the controversial extradition law amendment bill; an investigation into police brutality; Lam’s resignation; the release of arrested protesters; and the removal of the designation of the earlier clashes as a riot.

Facebook Twitter Pinterest Riot police fired teargas as they arrived to disperse protesters from the legislative council building. Photograph: Ritchie B Tongo/EPA

Lam called a rare press conference early on Tuesday to condemn the “extremely violent” storming of the legislature, which she described as “heartbreaking and shocking”.

Speaking beside Lam, police chief Stephen Lo said: “Protesters’ violent acts have far exceeded the bottom line of peaceful expressions of demands.”

A joint statement from 41 pro-government lawmakers condemned what they described as “extremely radical and violent acts”, such as the occupying of roads and vandalism of the council building.

The rallies are the latest manifestation of growing fears that China is stamping down on the city’s freedoms and culture with the help of the finance hub’s pro-Beijing leaders.

Although returned to Chinese rule in 1997, Hong Kong is still administered separately under an arrangement known as “one country, two systems”. The city enjoys rights and liberties unseen on the autocratic mainland, but many residents believe Beijing is reneging on that deal.

While the recent protests were initially sparked by Lam’s attempts to pass the proposed extradition legislation, the demonstrations have morphed into a wider movement against her administration and Beijing.

Quick guide Democracy under fire in Hong Kong since 1997 Show Hide Hong Kong’s democratic struggles since 1997 1 July 1997: Hong Kong, previously a British colony, is returned to China under the framework of “one country, two systems”. The “Basic Law” constitution guarantees to protect, for the next 50 years, the democratic institutions that make Hong Kong distinct from Communist-ruled mainland China. 2003: Hong Kong’s leaders introduce legislation that would forbid acts of treason and subversion against the Chinese government. The bill resembles laws used to charge dissidents on the mainland. An estimated half a million people turn out to protest against the bill. As a result of the backlash, further action on the proposal is halted. 2007: The Basic Law stated that the ultimate aim was for Hong Kong’s voters to achieve a complete democracy, but China decides in 2007 that universal suffrage in elections for the chief executive cannot be implemented until 2017. Some lawmakers are chosen by business and trade groups, while others are elected by vote. In a bid to accelerate a decision on universal suffrage, five lawmakers resign. But this act is followed by the adoption of the Beijing-backed electoral changes, which expand the chief executive’s selection committee and add more seats for lawmakers elected by direct vote. The legislation divides Hong Kong's pro-democracy camp, as some support the reforms while others say they will only delay full democracy while reinforcing a structure that favors Beijing. 2014: The Chinese government introduces a bill allowing Hong Kong residents to vote for their leader in 2017, but with one major caveat: the candidates must be approved by Beijing. Pro-democracy lawmakers are incensed by the bill, which they call an example of “fake universal suffrage” and “fake democracy”. The move triggers a massive protest as crowds occupy some of Hong Kong’s most crowded districts for 70 days. In June 2015, Hong Kong legislators formally reject the bill, and electoral reform stalls. The current chief executive, Carrie Lam, widely seen as the Chinese Communist party’s favoured candidate, is hand-picked in 2017 by a 1,200-person committee dominated by pro-Beijing elites. 2019: Lam pushes amendments to extradition laws that would allow people to be sent to mainland China to face charges. The proposed legislation triggers a huge protest, with organisers putting the turnout at 1 million, and a standoff that forces the legislature to postpone debate on the bills. After weeks of protest, often meeting with violent reprisals from the Hong Kong police, Lam announced that she would withdraw the bill. Photograph: Dale de la Rey/AFP

Both the protesters and the government have in recent weeks been trying to keep public opinion and attention on their side. The protesters have mostly been orderly, obeying traffic laws, cleaning up after themselves and allowing ambulances to pass even when tens of thousands are gathered.

They even returned to bow and apologise to civil servants after a small-scale protest forced government offices to shut and the staff to go home early.

Up until midnight police were far more restrained with their use of force, having been criticised for their actions against protesters at a smaller protest on 12 June, when they fired 150 rounds of teargas and rubber bullets, and videos of police beating and pepper-spraying unarmed protesters circulated over the internet.

The UK foreign secretary, Jeremy Hunt, on Monday stressed “UK support for Hong Kong and its freedoms”, saying in a statement that “no violence is acceptable but Hong Kong people must preserve the right to peaceful protest exercised within the law, as hundreds of thousands of brave people showed today.”

Facebook Twitter Pinterest Defaced portraits of Hong Kong officials in the legislative council building. Photograph: Kin Cheung/AP

UK diplomats will be concerned that the Hong Kong executive might use the violence as a reason to impose severe penalties on protesters, including possibly reintroducing the suspended extradition law. The UK had been privately pressing for the legislation to be dropped altogether.

China also reiterated its stance against what it called “foreign interference” in Hong Kong. Speaking in Beijing, the Chinese foreign ministry spokesman, Geng Shuang, said the UK’s rights and obligations under the joint declaration on the 1997 handover of Hong Kong had ended.

“Britain has no so-called responsibility for Hong Kong. Hong Kong matters are purely an internal affair for China. No foreign country has a right to interfere,” Geng told a daily news briefing.

“Recently Britain has continuously gesticulated about Hong Kong, flagrantly interfering. We are extremely dissatisfied with this and resolutely opposed.”

Earlier in the day, Lam, had attempted to calm the mood, as during an official ceremony took place at a convention centre in WanHong Kong’s Wan Chai todistrict to mark the 22nd anniversary of the handover.

In her speech, Lam referred to the protests, saying they had made her realise “the need to grasp public sentiments accurately”. She said: “I am also fully aware that while we have good intentions, we still need to be open and accommodating.”

Additional reporting by Patrick Wintour