Participants said the anniversary also comes amid widespread public anger at Hong Kong's own government, which has frequently been accused of caving in too easily to Beijing's interference in the city in recent years.
Much to Beijing's chagrin, people still display British colonial emblems out of nostalgia and longing for a time they feel had faster economic growth and better opportunities.
He landed Thursday from Beijing to preside over Saturday's handover anniversary rituals, when a Chinese aircraft carrier will make its debut in Hong Kong harbor - another marker of Beijing's assertion of control over the territory.
Xi has urged Hong Kong to boost its security and patriotic education.
"I am convinced that the practice of "one country, two systems" in Hong Kong will write a new chapter", he said.
Xi Jinping, the Chinese president, has evoked his country's "humiliation" at the hands of British imperialists during a trip to Hong Kong, as he sought to stir patriotism in a city where there are growing calls for more autonomy from the mainland.
In many major Hong Kong newspapers, coverage of protests has been eclipsed by exhaustive accounts of Xi's itinerary and quotes from him, at a time when the media stands accused of succumbing to pressure from Beijing.
"My priority will be to heal the divide and to ease the frustration - and to unite our society to move forward", Chief Executive-elect Carrie Lam said in March after her selection by a 1,200-person election committee stacked with Beijing loyalists. The key themes of the protests were reclaim Hong Kong and release of Liu Xiaobo, the jailed Chinese dissident and Nobel Peace prize victor who was recently diagnosed with cancer.
Syrian Kurds send military reinforcements to Aleppo to impede Turkish advance
Secretary of Defense Jim Mattis suggested on June 27 that the USA may continue to arm the Kurds after the battle of Raqqa. The YPG is an ally of the United States and has provided America intelligence for airstrikes against ISIS for years.
Chinese President Xi Jinping's pledge that the "one country, two systems" principle will continue to be implemented without change may placate the more pragmatic Hong Kongers who see value in having close links with an ascendant China.
The young democracy activists are calling for self determination and universal suffrage, but unlike the older generation of opposition politicians, they have questioned the validity of Hong Kong's Basic Law and constitution.
In a sweeping speech which saw the Chinese leader warn opponents in Hong Kong not to cross a "red line", he recalled how British victory in the First Opium War of 1839-42 - in which Hong Kong Island was ceded to Britain - set in motion decades of humiliation for China. "Not just because of the issues that Hong Kong represents in the 21st century, but because people say, 'You can always take China at its word.' Well, can you?"
And Cantopop stars Denise Ho and Anthony Wong, who were prominent in the 2014 Occupy Central movement, also marched. 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.
Hong Kong journalists, lawyers, students, religious leaders, teachers, business executives and other citizens have resisted every encroachment by Beijing.
"Making everything political or deliberately creating differences and provoking confrontation will not resolve problems", the President said, adding "On the contrary, it can only severely hinder Hong Kong's economic and social development".
The PLA is responsible for defending the city and comprises only mainland troops, with Hong Kong residents unable to serve, but it is barred from interfering in local affairs.
Mrs. Lam has said the government will enforce the law against calls for independence, but has not explained how such acts would be illegal in Hong Kong, which has strong protections for speech.