Pro-democracy lawmaker Au Nok-hin, former lawmakers and pro-democracy activists Lee Cheuk-yan and Leung Kwok-hung, also known as 'Long Hair', attend a protest against the Hong Kong police seeking a ban on the pro-independence Hong Kong National Party, outside the police headquarters in Hong Kong on July 18, 2018.

Hong Kong's democratic opposition failed to win back a crucial legislative council seat in an election on Sunday that would have restored some of its veto power at a time when the China-ruled city's freedoms are under strain.

The democratic camp's main candidate, Lee Cheuk-yan, lost to Rebecca Chan Hoi-yan, a pro-Beijing candidate backed by the Democratic Alliance for the Betterment and Progress of Hong Kong (DAB), by around 13,000 votes, or about 6 percent of the total.

Another democrat, Frederick Fung, who ran as an independent after a row with the opposition camp, split the vote to the benefit of the pro-establishment DAB.

With this loss, Hong Kong's 70-seat legislature becomes further dominated by pro-Beijing allies.

The city's opposition had also squandered an earlier chance to regain their veto power, garnering only two of four seats in a March by-election and leaving them one seat short of blocking most bills in the 70-seat chamber.

After 156 years of British colonial rule, Hong Kong returned to China in 1997 under a "one country, two systems" formula guaranteeing it a high degree of autonomy and the promise of eventual universal suffrage.

While the Democrats have enjoyed strong public backing in the past from a public aggrieved by China's creeping control of the Asian financial hub, they have struggled against a far larger and better funded pro-Beijing camp and unprecedented moves by authorities to curb electoral freedoms.

A pro-independence political party was banned this year, while several promising democracy activists were barred from contesting various polls after being deemed ideologically unsuitable for public office.

Sunday's by-election, and that in March, were triggered when six pro-democracy lawmakers were ousted over invalid oaths of office. Critics said the move was politically motivated, raising fresh questions over Hong Kong's reputation as a relative haven for freedoms not allowed anywhere in mainland China.

Some democrats said they would regroup and look ahead to the next city-wide legislative polls in 2020.

"We may be disappointed but we must never give up," Lee told reporters afterwards. "Because in Hong Kong's future, there are many more battles that need to be fought."

The poll comes at a time of increasing international concern about a perceived deterioration in Hong Kong civil liberties.

Nine activists including lawmakers and university professors are now facing public nuisance charges stemming from the massive pro-democracy "Occupy Central" protests in 2014. Their landmark trial could see them jailed for up to seven years.

A senior editor for the Financial Times, Victor Mallet, was also effectively expelled from the city in recent months, soon after he helped host a speech by an independence activist at the Hong Kong Foreign Correspondents' Club.

The U.S.-China Economic and Security Review Commission warned in a congressional report this month that China had "ramped up its interference" and had "closed down the political space for pro-democracy activists to express discontent".