Xi hinted that the central government was in favour of Hong Kong introducing "national security" legislation, a controversial issue that brought almost half a million people to the streets in protest in 2003 and ultimately forced former leader Tung Chee-hwa to step down.
The July 1 speech was tougher than speeches Mr Xi had given a day earlier to a business audience, where he had highlighted China's economic and technological success and the benefits it could bring to Hong Kong.Instead, he warned on Saturday that development was crucial for HongKong's survival in a competitive global economy and it "cannot afford to be torn apart by reckless moves or internal rifts".
On the eve of Xi's arrival in Hong Kong on June 29, members of pro-democratic groups, including Demosistō (香港眾志) and the League of Social Democrats (社會民主連線) occupied the statue on the Golden Bauhinia Square (黑紫荊廣場) to protest against the worsening economic and political environment in Hong Kong due to China's interference. A group of activists, including young pro-democracy leader Joshua Wong, were detained on Wednesday ahead of Xi's arrival after they staged a sit-in in front of an iconic sculpture of a gold Bauhinia flower - a monument to the handover.
But he said Hong Kong had to do more to shore up security and boost patriotic education, apparently referring to pieces of legislation long delayed by popular opposition.
The booksellers' case tapped into deep seated fears over how far China is reaching into Hong Kong and curbing freedoms.
They want the right to elect Hong Kong's leader: now Hong Kong's Chief Executive is elected by an electoral college of 1,200, stacked with pro-Beijing members.
In the handover agreement, ratified in 1985, Britain agreed to handover Hong Kong in 1997, and the agreement allowed for One Country, Two Systems, and Hong Kong's way of life under the U.K.to continue for 50 years.
Enjoying a light moment on the eve of the return anniversary, the president attended a grand gala marking the event at the waterfront Hong Kong Convention and Exhibition Center Friday night.
The challenges we face were exemplified by the 2014 Umbrella Movement demonstrations, when tens of thousands took to the streets to demand greater democracy - a demand that remains unmet.
However, many residents are increasingly concerned about mainland China's rising influence in Hong Kong.
Xi's visit comes amid heightened tension between China and Hong Kong.
Many protesters carried banners calling for his release, or pictures of empty chairs - echoing the award of his 2010 Nobel prize that took place while he was in prison.
Lam became Hong Kong's fifth chief executive since 1997 and the first female to hold the post.
She added, however, that "the Hong Kong people are very happy to see the back of Leung Chun-ying, who was the chief executive for the last five years and who really wreaked havoc in Hong Kong".
As more young people are identifying as Hong Kongers and requesting democracy, they are likely to resort to civil disobedience to make sure that the "core values" of "two systems" do not change, and the number of confrontations is expected to increase, he said.
"This has given businesses the trust, confidence and predictability to thrive in the region", Leung said in his remarks on Wednesday in NY at an event organized by the Hong Kong Economic and Trade Office to celebrate the 20th anniversary of the establishment of the HKSAR. Liu's face featured on countless signs held aloft by marchers who called on China to release him to seek treatment overseas.
"People are anxious. We understand that embassies all over Hong Kong are getting lots of queries from people seeking citizenship", said one senior diplomat at a major consulate.
Afterwards, Mr Chan introduced to President Xi the progress and characteristics of the HZMB Hong Kong Boundary Crossing Facilities as well as the Tuen Mun - Chek Lap Kok Link.
Lam's term will be divisive as it is likely that Beijing will press her to pass a controversial National Security law that would prevent treason, succession, sedition and subversion against the Central People's Government.