Britain returned Hong Kong to Chinese rule on July 1, 1997, with Beijing promising wide-ranging autonomy, unfettered individual rights and judicial independence at least until 2047.
China's critics, including Western nations, accuse authorities of trampling on those freedoms with a sweeping national security law imposed by Beijing on the city in 2020 in the aftermath of mass pro-democracy protests the year before.
China and Hong Kong reject the accusations, saying the law "restored order from chaos" so that the city can prosper.
Xi said the security law was beneficial for the "democratic rights" of the city's residents and that the "one country, two systems" formula would remain in place.
"For this kind of good system, there is no reason at all to change it. It must be maintained over the long term," Xi said.
Former security chief Lee, who is sanctioned by the United States over his role in implementing the security law, takes charge at a time when the city is facing an exodus of people and talent amid some of the toughest COVID-19 restrictions in the world.
Authorities deployed a massive security force, blocking roads and the airspace around the picturesque Victoria Harbour, where the last colonial governor, Chris Patten, tearfully handed Hong Kong back to China at a rain-drenched ceremony in 1997.
Red lanterns and posters declaring a "new era" of stability decorated main roads and walkways close to the convention centre
Xi did not attend the traditional flag-raising ceremonieson Friday, with media reporting he stayed overnight across the border in Shenzhen after arriving in Hong Kong on Thursday.
Xi's trip to Hong Kong is his first since 2017, when he swore in the city's first female leader, Carrie Lam, who oversaw some of the territory's most tumultuous times, marked by anti-government protests in 2019 and the COVID pandemic.
Five years ago, Xi stayed in Hong Kong for the duration of his trip. His overnight whereabouts this time, and the reasons why he may have chosen Shenzhen, have not been officially confirmed.
Hong Kong recorded more than 2,000 daily COVID cases on Thursday, levels which would result in very tight restrictions in any mainland city. China is alone among major countries in choosing to stamp out any outbreak as soon as it occurs at just about any cost.
Some analysts see Xi's visit as a victory tour after Beijing tightened its control of Hong Kong. After arriving in the city on Thursday, Xi said the city had overcome its challenges and "risen from the ashes".
Tens of thousands of demonstrators marched during Xi's visit five years ago, and July 1 had traditionally been used as an annual opportunity for Hong Kong people to voice grievances.
No protests are taking place this time, with the most outspoken opposition politicians and democracy activists either in jail or self-exile.
"The whole city has only one dominant voice and others are eradicated. It is quiet and 'harmonious' because it has lost its political diversity and freedom of expression," pro-democracy activist Nathan Law, who fled Hong Kong, said in a tweet. "It's 'one country, two systems' failure, not success."