"Any attempt to endanger China's sovereignty and security. or use Hong Kong to carry out infiltration and sabotage activities against the mainland is an act that crosses a red line", Xi said, in a nationalistic speech which emphasized Beijing's control over the city, now a special administrative region of China.
Xi's stern warning came at a gathering to mark 20 years of Chinese rule in Hong Kong and swearing-in of pro-Beijing new Chief Executive Carry Lam and her cabinet.
And he warned that anyone threatening China or Hong Kong's political stability would be crossing a red line and their actions would be considered "absolutely impermissible" - words certain to concern those already wary of tightening restrictions on political life in the city.
Experts said that the statements given by Xi are the strongest yet and it shows that China is getting increasingly annoyed with pro-democracy supporters in Hong Kong. Over two dozens democracy activists were detained by police after they staged a sit-in to protest against Xi's visit.
During his speech, Xi portrayed the "one country, two systems" formula, which ensures Hong Kong will retain its ways of life and freedoms after the handover, as a "new idea, new path" for the global community to tackle similar sovereignty issues.
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.
Beyond democracy, many protesters said they were also protesting about Hong Kong's many social problems, from staggering income inequality to corruption in government.
"Now Hong Kong has returned to the motherland's embrace for 20 years, the Sino-British Joint Declaration, as a historical document, no longer has any practical significance, and it is not at all binding for the central government's management over Hong Kong", Chinese Foreign Ministry spokesman Lu Kang said.
Young activists calling for self-determination or independence have emerged as a result.
And Cantopop stars Denise Ho and Anthony Wong, who were prominent in the 2014 Occupy Central movement, also marched.
Xi praised the government of Leung Chun-ying, who will end his tenure Saturday, when Carrie Lam is inaugurated on July 1 as Hong Kong's new chief executive.
Chris Patten, the city's last British colonial governor who presided over the handover in 1997, said that China had been pressuring Hong Kong "in all sort of ways".
The concept of "one country, two systems" gives expression to the vision of peace and harmony in the Chinese culture, and it embodies a very important tenet, namely, seeking broad common ground while setting aside major differences, Xi said.
The "one country, two systems" principle calls for the coexistence of the mainland's socialist system and Hong Kong's capitalism within the one nation of China.
However, ideologies held by localist groups and pro-Hong Kong independence groups are not the same, and the ideas people hold regarding independence change rapidly, Chan said.
"So they need more fluent Mandarin speakers in Hong Kong, or they hire people from China to work in Hong Kong so that they can communicate and talk effectively". They were demanding greater voting rights for Hong Kong, as well the immediate release of the Chinese dissident Liu Xiaobo.
In response to the United States and United Kingdom statements, Chinese foreign ministry spokesman Lu Kang detailed Hong Kong's "comprehensive achievements with the support of the central government and mainland".