Once one of Asia’s most high-flying cities, Hong Kong is now grappling with a deep pessimism.

The stock market is in the tank, home values have tumbled and emigration is fueling a brain drain. Some of the hottest restaurants, spas and shopping malls that local residents are flocking to are across the border, in the mainland Chinese city of Shenzhen.

“It pains me to say Hong Kong is over,” Stephen Roach, an economist and a former chairman of Morgan Stanley Asia long known for his optimism about the city, wrote in a recent commentary in The Financial Times.

The government needs to revive Hong Kong’s economy and promote its global image, but it has instead largely focused on national security. It moved with unusual speed on Tuesday to pass a package of updated and new security laws aimed at curbing foreign influence and dissent with penalties like life imprisonment for treason and other political crimes. The legislation could deter even more foreign businesses, already a shrinking presence, from investing in Hong Kong.

The malaise hanging over Hong Kong is partly a consequence of its status as a bridge between China and the West, with the city’s growth dragged down by the mainland’s sputtering economy and China’s tensions with the United States.

But at the heart of Hong Kong’s troubles is a crisis of identity, as the city’s Beijing-backed officials push the once freewheeling city away from the West and embrace the top-down political culture and nationalistic fervor of President Xi Jinping’s China.

“People are very unhappy for all kinds of reasons,” said Emily Lau, a veteran pro-democracy politician and former lawmaker who now hosts an interview show on YouTube. “Of course, the authorities will not admit it publicly, but I think they know it.”