Image copyright Getty Images Image caption Wang Zhimin served a little over two years as director of the liaison office

China has sacked the official in charge of relations with Hong Kong, Chinese state media reports.

Wang Zhimin was director of Beijing's liaison office for the territory.

The Xinhua news agency said Mr Wang had been replaced by Luo Huining, the Communist Party secretary for the northern province of Shanxi.

The sacking follows six months of often violent pro-democracy protests in Hong Kong that have tested Beijing's patience with top officials there.

Carrie Lam, the chief executive of Hong Kong, remains in office with the public support of the mainland leadership, despite being the face of a proposed bill which initially sparked unrest in March 2019.

The bill would have allowed for criminal suspects to be extradited from Hong Kong to mainland China, raising fears that the new law would be abused to detain dissidents and remove them from the territory.

Image copyright Reuters Image caption Anti-government protesters were detained on New Year's Day in Hong Kong

Hong Kong's protesters welcomed the new decade on Wednesday with a New Year's Day rally, which saw tens of thousands of people join a pro-democracy march. The gathering was largely peaceful, save for some small pockets of violence.

Police used water cannon to clear the Mong Kok market district and fired tear gas and rubber bullets at protesters.

Some 40 parliamentarians and dignitaries from 18 countries sent an open letter to Ms Carrie Lam on New Year's Eve, urging her to "seek genuine ways forward out of this crisis by addressing the grievances of Hong Kong people".

Hong Kong was a British colony until 1997, when it was returned to Chinese control under the principle of "one country, two systems". While it is technically part of China, the territory has its own legal system and borders, and rights including freedom of assembly and free speech are protected.