"Any attempt to endanger national sovereignty and security, challenge the power of the central government and the authority...or use Hong Kong to carry out infiltration and sabotage activities against the mainland is an act that crosses the red line, and is absolutely impermissible", Xinhua news agency quoted Xi as saying.
Chinese Consulate General in San Francisco Luo Linquan said he was proud of the successful practice of the "one country, two systems" policy over the past 20 years and pleased with Hong Kong's great economic and social achievements.
As a result, the Chinese economy has expanded rapidly in the past 20 years, while Hong Kong's position as an worldwide financial center has declined in relative terms. The same goes for books that present Xi and other top Communist Party leaders in a negative light, whether they be carefully argued scholarly works or lurid, gossipy biographies.
More than 100,000 people took to the streets in Hong Kong back in 2014 for 79 days to protest against Beijing's refusal to allow full democracy in the so-called "Occupy" civil disobedience movement.
In the midst of celebrations marking 20 years since Britain returned Hong Kong to China, Beijing declared that the document which initiated the handover "is no longer relevant". On Saturday, she formally became the city's first female chief executive and fourth leader since its transfer from British rule.
Young activists have formed new groups promoting independence or a local Hong Kong identity separate from the mainland, alarming Beijing.
Xi was seen off at Hong Kong's airport by the city's new leader, Carrie Lam, whose inauguration he presided over hours earlier, and other senior officials.
On Saturday, pro-democracy protesters clashed with police amid increased security across the city for Xi's visit.
Ahead of Mr Xi's arrival, 26 pro-democracy activist were arrested and detained for trying to scale an iconic statue symbolising the take-over.
Since Hong Kong's return to the motherland two decades ago, the successful practice of the "one country, two systems" in Hong Kong has won global recognition, Xi said. The news that Nobel prize victor and Chinese dissident Liu Xiaobo is terminally ill and has only recently been granted medical parole has been another source of discontent.
In the midst of this unsettling atmosphere and unprecedented security measures, Chinese President Xi Jinping landed on Thursday in a city decorated with the flag for his visit, the first since he took office in 2013. We have fought to preserve our core values, including the rule of law, transparency, a free flow of information and free markets - the values that have always been a beacon for China and beyond. "It used to be that you got out of college in Hong Kong, you were an invaluable resource because you had some sort of Mandarin skills, you spoke English and you were trained in finance, and you had no competition", says Andrew Collier, managing director of Orient Capital, and author of Shadow Banking and the Rise of Capitalism in China.