China's President Xi Jinping said today Hong Kong was freer than ever before but warned against "impermissible" challenges to Beijing's authority as the city marked 20 years since it was handed back by Britain.
Xi spoke in a televised address after swearing in new Hong Kong leader Carrie Lam as pro and anti-Beijing protesters clashed close to the ceremony.
Lam was selected by a pro-China committee, as were her predecessors, and is already being cast by critics as a China stooge in a city where many are angry at Beijing's tightening grip on the freedoms of nearly eight million people.
Xi said that any threats to the authority of China's communist party government "cross the red line and are absolutely impermissible".
The warning comes after the emergence of young activists calling for self-determination or even full independence for Hong Kong, which has infuriated Beijing.
He added that Hong Kong had "more extensive democratic rights and freedoms than at any other time in its history".
Lam took her oath of office under China's national flag at the city's harbourfront convention centre, before shaking hands with Xi.
Her inauguration comes a day after Beijing's foreign ministry declared that the document signed by Britain and China which initiated the handover "is no longer relevant".
The Sino-British Joint Declaration gave Hong Kong rights unseen on the mainland through a semi-autonomous "one country, two systems" agreement, lasting 50 years.
There are growing fears that those freedoms are now under threat from an assertive Beijing, with Chinese authorities accused of interfering in a range of areas in Hong Kong, from politics to media and education.
Pro-China protesters targeted a small march by activists in memory of the victims of Beijing's 1989 Tiananmen Square crackdown Saturday morning as officials gathered for the swearing in.
As the pro-democracy campaigners prepared to carry a makeshift coffin towards the convention centre, as they do each year, a man ran across the street and kicked it.
Flag-waving pro-China protesters then blocked the march as police struggled to separate the two sides.
Democracy campaigners were taken away in police vans and released soon after.
Lam's swearing in by Xi is deeply symbolic for frustrated activists who have been pushing for fully free leadership elections for the city, with mass pro-democracy "Umbrella Movement" rallies bringing parts of the city to a standstill in 2014.
Those protests were sparked by a Beijing-backed political reform package which said Hong Kong could have a public vote for leader, but that candidates must be vetted first.
The proposal was voted down in parliament by pro- democracy lawmakers and the reform process has now stalled.
Lam has made no commitment to revisit it soon.
The failure of the democracy movement to win concessions has led some young campaigners to call for self-determination or even independence for the mainland, which has infuriated Beijing.