Hong Kong voted on Sunday in its first major election since pro-democracy protests in 2014 and one of its most contentious ever, with a push for independence among disaffected younger voters stoking tension with China's government.
The vote is for a 70-seat legislative council in which Hong Kong's pro-democracy opposition is hoping to maintain a one-third veto bloc in the face of better mobilized and funded pro-Beijing rivals.
The former British colony was handed back to China in 1997 under a "one country, two systems" agreement that promised to maintain the global financial hub's freedoms and separate laws for at least 50 years, but gave ultimate control to Beijing.
A growing yearning for independence and animosity towards Beijing in the southern coastal city pose one of the central government's most pressing domestic political issues.
The stakes for Beijing are particularly high this weekend as G20 leaders gather in the eastern city of Hangzhou for a summit.
Hong Kong's opposition now controls 27 of the legislature's 70 seats, giving it the power to block policies and some laws including legislation it sees as eroding freedoms.
Some 3.8 million of Hong Kong's seven million people are eligible to vote and the result is due early on Monday.
It will give an indication of anti-China sentiment some two years after tens of thousands took to Hong Kong streets to demand full democracy from China's Communist Party leaders.
A younger generation of voters who joined those protests is openly advocating independence - a push some people warn could jeopardize Hong Kong's economic and political future.
China's stability-obsessed leaders have categorically rejected any possibility of independence.
Hong Kong officials are generally supportive of Beijing and keen to preserve "one country, two systems", though confidence in China's commitment to the formula has been shaken by recent incidents including the abduction of several Hong Kong booksellers by Chinese agents.
"You may be disappointed by the fact that Hong Kong, the city we love, has not been making more progress," Carrie Lam, the head of Hong Kong's civil service, told reporters as she cast her ballot.
"I urge you to vote because indifference will not lead us anywhere."
Many residents see the 79 days of student-led protests in 2014 as a turning point in the city's politics even though Beijing gave no ground.
Since then, many have decried what they see as increasing Beijing interference to stifle dissent and civil liberties.
Six pro-democracy election candidates were disqualified for refusing to uphold a clause in Hong Kong's mini-constitution, or Basic Law, stating it is an "inalienable" part of China.
"The rights we should have under the Basic Law don't belong to us anymore," said Baggio Leung of Youngspiration, a group pushing for self-determination.
"We are telling Beijing we don't believe they are going to protect us."
China has launched a campaign to try to sway the vote through its channels of influence including state companies and grassroots associations.
"It is an open secret that they ... pull strings, they make threats, they plant votes," said Anson Chan, a former senior Hong Kong official.
The city's Beijing-backed leader, Leung Chun-ying, rejected any suggestion of interference.
"Our election is a democratic one," Leung told reporters after casting his vote, when an activist threw a sandwich at him.
"Voters have their own free choice and don't need anyone to tell them how to vote."