Hundreds of protesters stormed Hong Kong's parliament late on Monday, ransacking the building and spraying graffiti on its walls.
The city was plunged into political chaos as marches to mark 22 years since Hong Kong's handover to China from the UK boiled over.
One group ran riot after breaking in to the legislative building and tens of thousands of others marched through the city to demand expanded democracy. The island has experienced weeks of demonstrations that began over a bill that would allow extradition to China.
The proposed legislation, on which debate was suspended indefinitely, increased fears of eroding freedoms in the territory.
Hong Kong leader Carrie Lam suspended the bill on June 15 after some of the largest and most violent protests in the city in decades. However, the demonstrations have continued, with protesters calling for the bill to be completely dropped and for Ms Lam's resignation.
Black-clad protesters wearing hard hats and face masks torn down part of a glass and metal exterior wall of the legislature building, which was ordered to be closed and workers sent home.
The actions prompted organisers to change the rallying point of the protest march from the legislature to a nearby park, after police asked them to either call it off or change the route. Police wanted the march to end earlier in the Wan Chai district, but organisers said that would leave out many people who planned to join the march along the way.
Riot police in helmets and carrying batons earlier fired pepper spray as the standoff continued into the sweltering heat of the evening.
The government called for an immediate end to the violence, saying it had stopped all work on extradition bill amendments and that the legislation would automatically lapse in July next year.
There was no immediate response from the protesters.
Reuters reported that some of the protesters sat at legislators' desks, while others scrawled "Withdraw anti-extradition" on the walls.
Ms Lam said on Monday that the protests have taught her that she needs to listen better to young people and citizens in general.
"This has made me fully realise that I, as a politician, have to remind myself all the time of the need to grasp public sentiments accurately," she said in a five-minute speech to the gathering.
She insisted her administration had good intentions, but said she would "learn the lesson and ensure that the government's future work will be closer and more responsive to the aspirations, sentiments and opinions of the community."
The extradition bill controversy has given fresh momentum to Hong Kong's pro-democracy opposition movement, awakening broader concerns that China is chipping away at the rights guaranteed to Hong Kong for 50 years under a "one country, two systems" framework. The two marches in June drew more than a million people, according to organiser estimates.
Jimmy Sham, a leader of the pro-democracy group that organised the march, told the crowd that Ms Lam had not responded to their demands because she is not democratically elected. The leader of Hong Kong is chosen by a committee dominated by pro-China elites.
"We know that Carrie Lam can be so arrogant," Mr Sham said, rallying the crowd under a blazing sun before the start of the march at Victoria Park. "She is protected by our flawed system."
Hong Kong campaigners handed a letter to Britain's government on Monday demanding the right to stay in the UK.
They say Britain should upgrade the rights of British Overseas Territory passport holders, a category created when Britain returned Hong Kong to Chinese rule.
Passport holders can visit the UK for up to six months but have no automatic rights to live and work in Britain.
Karl Lee, a 32-year-old protester, told Reuters that "many of us are thinking of relocating to the United Kingdom".
The protesters are also demanding an independent inquiry into police actions during a June 12 protest, when officers used tear gas and rubber bullets to disperse a demonstration that blocked the legislature on the day that debate on the bill had been scheduled to resume.
The police say the use of force was justified, but since then have largely adopted softer tactics, even as protesters besieged police headquarters in recent days, pelting it with eggs and spray-painting slogans on its outer walls.
The area around Golden Bauhinia Square, where the flag-raising ceremony took place, was blocked off from Saturday to prevent protesters from gathering to disrupt it. Before the morning ceremony, protesters trying to force their way to the square were driven back by officers with plastic shields and batons, the retreating protesters pointing open umbrellas to ward off pepper spray.
"We are horrified. This is our obligation to do this, we are protecting our home," said Jack, a 26-year-old office worker, told AP. "I don't know why the government is harming us. It's harming the rule of law; the rule of law is the last firewall between us and the Chinese Communist Party."
During a brief visit to Mongolia on Monday, US National Security Adviser John Bolton said Washington expects "China like every other country to adhere to its international obligations" regarding Hong Kong.
China rejects all such statements as foreign interference. In Beijing, Chinese foreign ministry spokesman Geng Shuang told reporters at a daily briefing that "Hong Kong affairs are purely China's internal affairs, and no foreign country has the right to intervene."