Chinese President Xi Jinping strongly endorsed Hong Kong's leader Carrie Lam on Wednesday, saying the former British colony had transformed "from chaos to order" since a controversial security law was imposed last year, the city's media reported.

China has overseen a sweeping crackdown in Hong Kong after huge and often violent democracy protests two years ago, introducing a national security law that criminalised much dissent and introduced political rules that vet the loyalty of anyone standing for office.

The first public vote under this new order was held on Sunday for the city's legislature, with a historic low turnout recorded.

Despite only 30 percent of the electorate casting ballots, Lam appeared to be given support by the central government on a three-day visit to Beijing this week.

Beijing "fully affirms" the Lam administration's work, Xi told the territory's chief executive in opening comments at a meeting shown by broadcaster RTHK and other Hong Kong TV channels.

Hong Kong's leader Carrie Lam received a strong endorsement from Chinese President Xi Jinping after the city held elections under a Beijing-led national security law
Hong Kong's leader Carrie Lam received a strong endorsement from Chinese President Xi Jinping after the city held elections under a Beijing-led national security law AFP / Peter PARKS

The situation was "continuously changing for the better", Xi said, adding the weekend's vote had been "held successfully" under Beijing's changes to Hong Kong's electoral system.

Xi told Lam the Hong Kong government had taken "firm steps to push forward Hong Kong's democratic development in accordance with actual situation", according to RTHK footage.

The Hong Kong government had "resolutely implemented" the national security law, "stopped chaos and disorder in a lawful manner, restored what's right, and protected the authority and dignity of the rule of law."

"The democratic right of our Hong Kong compatriots to be masters of their own home has been realised," Xi said, adding that the principle of "patriots governing Hong Kong" had been implemented.

Xi also commended the Lam administration's efforts to restore public order and economic growth in the financial hub.

However, world powers including the European Union and the G7 group have condemned the legislature vote, saying the new rules had eroded democracy in Hong Kong, which was returned to the mainland from British rule in 1997.