Hong Kong's legislature passed a contentious bill that outlaws disrespecting the Chinese national anthem amid a wave of protests by pro-democracy lawmakers who claimed it will encroach on people's rights and freedoms.

The bill's passage, by a 41-to-one vote, came on the 31st anniversary of the bloody crackdown on pro-democracy, student-led demonstrators in Beijing's Tiananmen Square, while a candlelight vigil was banned in the territory in the name of health concerns amid the coronavirus pandemic.

Andrew Leung Kwan-yuen host the council meeting at the main chamber of the Legislative Council during the third reading of debate ahead of the vote on the Chinese national anthem on June 4, 2020 in Hong Kong, China. (Getty/Kyodo)

Earlier in the day, lawmakers Roy Chan and Eddie Chu were expelled from the legislative chamber during a debate session on the bill after they spilled a foul-smelling liquid while trying to charge at acting president Starry Lee.

"What we did today is to remind the world that we should never forgive the Chinese Communist Party for killing its own people 31 years ago," Chu told reporters while holding a placard that read: "Murderer state stinks forever."

"We are here also to stop the national anthem ordinance, which is definitely going to restrict the freedom and human rights of Hong Kong people."

Moved to a conference room to avoid the stench, Legislative Council President Andrew Leung shortened the rest of the debate session and moved directly to vote as pro-democracy lawmakers jeered and tried in vain to disrupt the meeting.

The law lists out penalties for misusing the score or the lyrics of the anthem "March of the Volunteers" and for insulting behavior such as publicly and intentionally playing and singing the anthem in a distorted or disrespectful way.

Offenders could face a maximum penalty of three years' imprisonment and a HK$50,000 (about $6,400) fine.

Earlier in the morning, some 20 pro-democracy lawmakers staged a walkout after observing a moment of silence to remember the people killed in the 1989 crackdown.

Citing the need for social distancing amid the pandemic, police have, for the first time, banned a commemorative vigil at Victoria Park.

Since 1990, tens of thousands of people have lit candles at the public park every year on the June 4 anniversary.

An organizer of the event, former lawmaker Lee Cheuk-yan, said a small group of people will still enter the park despite the ban.

Lee urged people who want to join, to light up candles across the territory at 8 p.m. when a memorial is held online.

"The world is watching, on how the government is handling the memorial," Lee said.

Some 3,000 police officers, as well as two water cannon trucks, were said to be on standby for the day in case of unrest during the anniversary events or the voting on the anthem bill, local media reported.

On Wednesday, EU Commission foreign affairs and security policy spokeswoman Virginie Battu-Henriksson said the people of Hong Kong and Macau must be free to mark the anniversary.

"Hong Kong and Macau have indeed long tradition of commemorating the Tiananmen Square democracy protest of 1989, and the violent suppression," she said. "This commemoration is a strong signal that key freedoms continued to be protected."