Chinese President Xi Jinping has warned against "impermissible" challenges to Beijing's authority over Hong Kong.
Mr Xi was speaking at the swearing-in of the territory's new leader Carrie Lam, as Hong Kong marked 20 years since its handover to China from Britain.
On Saturday afternoon, after Mr Xi had left Hong Kong, thousands of people took part in an annual march calling for greater democracy.
During Mr Xi's visit there was little opportunity for protest.
An earlier protest had led to clashes with pro-Beijing demonstrators.
Mr Xi's visit to the city - his first since becoming Chinese leader in 2013 - came amid tight police security.
Several people were detained in the morning, when a small group of pro-democracy activists clashed with pro-Beijing demonstrators close to the site where the lavish ceremony took place.
More at Xi Jinping warns Hong Kong over sovereignty 'red line'
Mr Xi was speaking at the swearing-in of the territory's new leader Carrie Lam, as Hong Kong marked 20 years since its handover to China from Britain.
On Saturday afternoon, after Mr Xi had left Hong Kong, thousands of people took part in an annual march calling for greater democracy.
During Mr Xi's visit there was little opportunity for protest.
An earlier protest had led to clashes with pro-Beijing demonstrators.
Mr Xi's visit to the city - his first since becoming Chinese leader in 2013 - came amid tight police security.
Several people were detained in the morning, when a small group of pro-democracy activists clashed with pro-Beijing demonstrators close to the site where the lavish ceremony took place.
More at Xi Jinping warns Hong Kong over sovereignty 'red line'