While he said the central government was ready to talk to anyone regardless of their political views, Xi spent a significant part of his 30-minute speech warning against challenges to sovereignty and urging the city to improve its system to uphold national security, sovereignty and development interests.
Xi's three-day visit is his first since becoming leader in 2013, and comes three years after huge pro-democracy rallies crippled Hong Kong.
Several pro-democracy groups protested against Xi's visit and scuffled with pro-China organisations and police.
"First give us our democracy second believe in the Hong Kong people and thirdly stop destroying 'one country, two systems, '" she said.
In addition to mainland China, these positions also imply a break with previous generations, who are prone to be away from politics as long as the economy thrives, and with the traditional pan-democratic parties, for whom their Chinese identity is not in question even if they do not share the Decisions of the Communist authorities.
Helicopters flew overhead as onlookers cheered at the ceremony in Golden Bauhinia Square, central Hong Kong.
Trump sends 20 additional federal agents to Chicago to battle gun violence
The number of murders - 320 so far in 2017, compared with 322 at this point a year ago - has hardly changed. The unit is also meant to team up front-line law enforcement officers with state and federal prosecutors.
Observers said Xi's line was tougher than that of two predecessors despite his moderate presentation, while pan-democrats remained sceptical that Beijing could accept regular dialogue with democratic dissenters.
Others demanded that Hong Kong's outgoing chief executive, Leung Chun-ying, be locked up over corruption allegations, and many slogans were simply words of encouragement for a movement that has seen little progress on democracy: "Never back down", "Fight for Hong Kong", and, more poetically, "Being born in uncertain times carries certain responsibilities".
But in a stark and surprising announcement, the Chinese Foreign Ministry said the 1984 Sino-British Joint Declaration on Hong Kong, which laid the blueprint over how the city would be ruled after 1997, no longer had any practical significance. Over the past two years, Hong Kong booksellers who specialized in gossipy tales of Chinese leaders and a politically connected billionaire have ended up on the mainland, apparently after being grabbed by security officers operating outside their legal authority.
The battle for full democracy, vividly illustrated by 79 days of "Occupy" street protests in 2014, has been a defining issue for the city of 7.3 million.
They had been trying to march towards the city's convention centre, where President Xi Jinping was swearing in the territory's new leader, Carrie Lam. "All we're asking for is what was promised: to have a high degree of autonomy and govern ourselves, but the Chinese government only wants to control Hong Kong".
And while there are Hong Kongers who welcome Mr Xi's visit, there are also some who resent the disruption of people's daily life through the elaborate security arrangements. They were swiftly stopped by police and Chinese flag-waving counter protesters, with the action ending about an hour later.
A prominent theme in this year's march was the call for the release of cancer-stricken Chinese dissident Liu Xiaobo, who was given medical parole earlier this week but is still on the mainland.
President Xi travelled through the Hong Kong Link Road (HKLR) Scenic Hill Tunnel, which was connected in May this year, to inspect the HZMB HKLR.