Hong Kong leader Carrie Lam has condemned the "extremely violent" storming of the city's parliament building by protesters.

The unprecedented display of defiance came on the anniversary of the territory's return to Chinese rule in 1997.

At a news conference, Ms Lam described the events "heartbreaking and shocking" and said she hoped society would "return to normal as soon as possible," while acknowledging that thousands had marched peacefully in the city before the unrest.

Masked protesters - mostly young and many wearing yellow hard hats - broke into the legislature after hours of clashes with police.

They ransacked the building, destroying pictures and daubing its walls with anti-government graffiti, in an unparalleled challenge to city authorities and Beijing.

Police used tear gas and baton charges to clear hundreds of demonstrators outside the Legislative Council in the heart of the former British colony's financial district.

They then moved inside where masked protesters had stormed the chamber after successfully breaching the complex's reinforced glass windows.

Once inside the protesters tore down portraits of the city's leaders, hoisted a British colonial era flag in the main chamber and sprayed the city crest with black paint.

Protesters hoisted a British colonial era flag in the main chamber

Some carried road signs, others corrugated iron sheets and pieces of scaffolding upstairs and downstairs as about a thousand gathered around the Legislative Council building in the heart of the city's financial district.

Some sat at legislators' desks, checking their phones.

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.

The Legislative Council Secretariat released a statement cancelling business for tomorrow "owing to security consideration".

Banners hanging over flyovers at the protest site read: "Free Hong Kong."

Hong Kong has been rocked by three weeks of historic demonstrations against a hugely unpopular bill that would allow extraditions to the Chinese mainland.

Tens of thousands of democracy activists staged another large, peaceful march through the city today, calling for the city's pro-Beijing leader to step down and reverse what they see as years of sliding freedoms.

But that rally was overshadowed by small groups of mainly young, masked protesters who seized roads and tried to break into the legislature, sparking renewed clashes with police after two weeks of relative calm.

The huge rallies over the last three weeks are the latest expression 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.

But the increasingly hardline tactics from some protesters have alienated some, with a large counter-rally in support of the police taking place yesterday.

Although Hong Kong returned from British to Chinese rule on 1 July 1997, it 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 fear Beijing is already reneging on that deal.

Activists have organised a march every handover anniversary, calling for greater democratic freedoms - such as the right to elect the city's leader.

They have mustered large crowds in recent years - including a two-month occupation of parts of the city centre in 2014 - but have failed to win any concessions from Beijing.

This year's rally is framed by unprecedented anti-government protests of the past three weeks that have drawn millions, with the public angry over police use of tear gas and rubber bullets.

The spark for the current wave of protests was an attempt by Ms Lam to pass the Beijing-backed extradition law, which she has now postponed following the public backlash.

But she has resisted calls to permanently shelve the law or step down.

As a result the demonstrations have morphed into a wider movement against her administration and Beijing.

Ms Lam - who has kept out of the public eye since her climbdown and has record low approval ratings - attended a flag-raising ceremony early today, marking the moment the city returned to Chinese ownership 22 years ago.

Carrie Lam (3rd L) and other guests raise a toast after watching the annual flag raising ceremony

But she and other dignitaries watched from indoors due to "inclement weather" - the first time in the ceremony's history.

Her speech stuck to the conciliatory tone she has used in recent weeks.

"What happened in recent months has caused conflicts and disputes between the government and residents," Ms Lam said.

"It has made me fully understand that as a politician, I need to be aware and accurately grasp the feelings of the people."

She then raised a champagne toast alongside cabinet officials and two of her predecessors.

Police said 13 officers were also sent to hospital after being doused by an "unknown liquid" from protesters while the government released a statement condemning protesters for using "extreme violence."

But activists have vowed to keep up their civil disobedience campaign.

"Whatever happens we won't lose heart," a 22-year-old protester added.

"Resistance is not a matter of a day or a week, it is long term."