HONG KONG — Pro-democracy forces swept Hong Kong district council elections over the weekend, boosting pressure on the city's Beijing-backed government to listen to protesters' demands for greater freedoms.

China responded sternly to the landslide in the vote widely seen as a referendum on public support for the anti-government movement. Foreign Minister Wang Yi said that no matter how the situation in Hong Kong changes, the semiautonomous region is part of China.

"Any attempt to disrupt Hong Kong and damage [its] stability and prosperity will not succeed," he told reporters in Japan, where he was attending a G-20 foreign ministers meeting.

Ministry spokesperson Geng Shuang added Monday that Hong Kong's most urgent task is to restore order as protesters continue to clash with police.

Pro-democracy supporters chant as they celebrate the loss of a pro-Beijing candidate in Hong Kong's district council elections on Monday. Philip Fong / AFP - Getty Images

Geng also stressed that tensions in Hong Kong are purely China's internal affairs.

“The determination of the Chinese government to safeguard the interests of national sovereign security and development is unshakable,” he was quoted as saying by Global Times, a hawkish newspaper owned by the Chinese Communist Party.

China has blamed Western governments for fomenting the unrest in the former British colony.

For months, Hong Kong protesters have been demanding that China loosen its grip.

Beijing has steered clear of interfering directly, saying that it trusts Hong Kong’s embattled leader Carrie Lam to handle the situation. However, the protests have presented Chinese leader Xi Jinping with one of the biggest popular challenges since he came to power in 2012.

Although district councils have little power and the election is normally a low-key race, over 2.9 million cast their votes in Hong Kong on Sunday in a 71 percent turnout, exceeding the 2015 participation levels by almost 25 percent.

The pro-democracy camp had won a commanding majority of the 452 district council seats at stake, taking control of at least 17 of the city’s 18 district councils in a rebuke to Beijing-backed Lam and her handling of the protests.

Hong Kong's so-called "pan-democrats" are a group of pro-democratic political parties who have been calling for preservation and expansion of existing freedoms enshrined in law after the former British colony was handed over to China in 1997.

“The electoral results are a huge embarrassment to the entire pro-Beijing camp,” associate professor Kenneth Chan with the department of government and international studies at Hong Kong Baptist University told NBC News.

“I have talked to a few of them and they’re struggling to come up with an answer. The verdict has been passed and the government cannot ignore the public opinion," he said, adding that Lam is waiting for Beijing’s order for her next move.

“She doesn’t know what to do. The whole country has no idea about the scale and importance of this election."

People queue to cast their vote in the district council elections in Tseung Kwan O district of Hong Kong on Sunday. Ye Aung Thu / AFP - Getty Images

Lam issued a statement Monday, saying her government respects the election outcome and promised to “humbly listen” to the public’s opinions.

“There are various interpretations related to the results, and quite a few view it as a reflection of people's dissatisfaction with the current situation and society's deep-seated problems,” she acknowledged.

The vote is the only fully democratic one in Hong Kong. Members of the Legislature are chosen partly by popular vote and partly by interest groups representing different sectors of society, and the city’s leader is picked by a 1,200-member body that is dominated by supporters of the central government in Beijing.

Jasmine Leung reported from Hong Kong. Leou Chen from Beijing. Yuliya Talmazan from London.