Chinese President Xi Jinping has arrived in Hong Kong to mark 25 years since the former British colony returned to Beijing's rule.
It is his first visit outside mainland China since the start of the pandemic nearly two-and-a-half years ago.
He said Hong Kong had "risen from the ashes" after a series of challenges.
China took control over the territory after pro-democracy protests in 2019-20 and has been accused by critics of crushing Hong Kong's freedoms.
Mr Xi, who travelled by high-speed train, was greeted at the station by pupils holding flowers and waving flags of China and Hong Kong.
"In the past Hong Kong has withstood severe tests again and again, overcoming challenges one by one," he said in a brief speech, perhaps referring to the mass protests three years ago.
He said "one country, two systems" - the governance model agreed for 50 years in the handover - "can ensure the long-term prosperity and stability of Hong Kong".
Under the deal, the international business hub was allowed to retain a degree of autonomy and freedom not seen in the rest of China, but critics say these are being rapidly eroded.
Security is tight around the convention centre that is hosting official events marking the anniversary, with roads closed and a no-fly zone overhead.
An expected typhoon may dampen the celebrations, which have seen city streets fill with China's red flags and posters proclaiming a "new era" of stability.
No details of the president's itinerary during the two-day visit have been made public. Reports say he is staying the night in the nearby city of Shenzhen. Mr Xi has not left mainland China since it closed its borders in early 2020 after the outbreak of coronavirus.
Hong Kong's outgoing chief executive Carrie Lam and her successor John Lee were among those who welcomed Mr Xi at a high-speed railway terminus not used for over two years because of Covid-19. He is expected to return to the city on Friday to oversee the inauguration of its new leader.
Ms Lam and Mr Lee, a former senior policeman, along with other officials meeting the president in person, have been taking daily Covid tests and staying in a quarantine hotel ahead of the visit, reports say.
Mr Xi's arrival has been so shrouded in secrecy that a few pro-Beijing politicians complained on local radio talk shows that they had missed the chance to quarantine and been unable to meet the nation's leader.
Media bosses were also annoyed after some journalists were refused accreditation at the very last minute "on security grounds".
"We have an obligation to keep it secret," assistant police commissioner Lui Kam-ho told a recent news conference.
Twenty-five years ago, when Prince Charles and Lord Patten left Hong Kong after the handover, there was also a rainy sky - but no such secrecy.
Mrs Lam mentioned nothing about her immediate future plans in her final press meetings. She is currently under US sanctions, which make her unable to bank her salary, reported to be worth a few hundred thousand dollars per year.
Before the handover, China promised to protect democratic freedoms for 50 years in the special administrative region - but new laws introduced in 2020 have effectively silenced all criticism in the territory.
The government in Beijing can veto changes to the political system, and pro-democracy forces have been frustrated by what they see as the slow pace of political reform.
Tens of thousands of protesters took to the streets in Hong Kong when Mr Xi last visited, in 2017. This time no demonstrations are expected - many of the city's most prominent pro-democracy figures are either jailed or have left.
Watch Hong Kong: Life Under the Crackdown on BBC iPlayer (UK only).