Mr. Xi praised her “courage and responsibility,” but he also offered an implicit warning to protesters, saying that Beijing had an “unwavering determination to safeguard national sovereignty, security and development interests.”

Context: The visit to Beijing over the weekend and on Monday was an annual year-end event for Hong Kong’s leaders, at which their performance is assessed by China’s leaders. The trip is being closely watched for signs of her fate.

Related: Mrs. Lam also met with China’s No. 2 official, Premier Li Keqiang, who also praised her but called on her government to continue working to “stop the violence and curb disorder.”