President Xi Jinping warned a divided Hong Kong that challenges to China’s rule wouldn’t be tolerated and said the city’s leaders must find new ways to profit from Chinese economic clout. Xi’s stern speech Saturday—at a ceremony in which he swore in Carrie Lam, 60, as Hong Kong’s first female chief executive—capped a three-day trip to mark the 20th anniversary of the former British colony’s return to China. The president said the city’s leaders must build political consensus, devise new economic drivers and address soaring home prices. “It is imperative to always focus on development as the top priority,” Xi told the gathering of the city’s political and business leaders, saying that growth held “the golden key to resolving various issues in Hong Kong.” Any attempts to challenge the Chinese government “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,” he said. Since the last Chinese president visited five years ago, Hong Kong has been racked by doubts about the city’s growth model, protests for greater democracy and the emergence of a small independence movement. The trip demonstrated Xi’s intolerance for challenges to Chinese sovereignty while showcasing the confidence he has displayed abroad as growing clout gives his country less reason to hide its strength and abide international pressure.  “Xi sent a clear sovereign message: ‘You belong to us, and your future is with us,’” said David Zweig, a political science professor at the Hong Kong University of Science and Technology. “Maybe it will finally put to sleep the democrats’ unfailing belief that somehow Xi is going to offer a package that will solve the political problems of Hong Kong.” Thousands of police officers were deployed to keep protesters far away from Xi, and those lining nearby streets during the ceremony appeared largely supportive of Chinese rule, waving red national flags. Scuffles broke out when several pro-democracy demonstrators tried to carry a mock coffin to venue. Joshua Wong, 20, a leader of the mass Occupy protests in 2014 who now runs his own political party, said he was detained by police and released. After Xi’s departure Saturday, thousands joined an annual pro-democracy march through the streets. Attendees carried banners calling for the downfall of the Communist Party and the arrest of city’s former chief executive Leung Chun-ying.  Many were unconvinced by Xi’s promise of prosperity, which they said would probably benefit the wealthy most. The city, long lauded by economists for its business freedom, has the biggest wealth disparity in Asia. Apartments the size of parking spots cost $500,000 and median wage earners would have to save for 80 years to buy a home. “Xi always stresses that they bring us economic opportunities,” said Ruth Wong, a 29-year-old social worker. “But can you say it benefits most of the Hong Kong people? I think those who benefit are those who have vested interests, like the property developers.” During Xi’s visit, the Hong Kong stock exchange announced that foreign investors would from Monday gain access to China’s $10 trillion debt market through a local bond connect. He also oversaw the signing of an agreement to develop innovation as well as closer economic links among Hong Kong, neighboring Macau and nine cities in Guangdong province. ‘Restoring Faith’ Earlier Saturday, Lam presided over a reenactment of the flag-raising first performed in 1997 when the British ended their 156-year rule. After taking her oath as chief executive, the one-time colonial civil servant pledged to strengthen the public’s faith in the government and include younger people in political discussions. “There has been a tendency to make cynical accusations, and to put personal grudges before objective facts,” Lam said. “This has hurt the executive-legislature relationship, hindered governing effectiveness and directly dragged down our economic and social progress.” Many residents have also grown skeptical of China’s promise to maintain Hong Kong’s autonomy—including free speech and independent courts—under a framework called “one country, two systems.” The failure to hold direct elections for the city’s leader and recent Chinese interventions in the Hong Kong’s legal affairs have energized young activists who led mass democracy protests almost three years ago and now advocate “self-determination.” Both Xi and Lam stressed the need to improve opportunities, as young people face increased competition from Mandarin-speaking mainlanders. Xi called for policies to “enhance education and raise public awareness of the history and culture of the Chinese nation,” in a possible nod to a national education proposal shelved in 2012 amid student protests. “Integration with China will be very good for Hong Kong’s economy, but Xi Jinping must realize that many of us have never known true Communist rule,” said Mike Lee, 20, who works as a waiter at a coffee shop near where the president spoke. “We have been born into freedom. China has to be indulgent of Hong Kong’s aspirations.”