(Bloomberg) -- Beijing finally pulled the trigger on national security legislation for Hong Kong, sowing panic in the city’s $5 trillion stock market.

The Hang Seng Index plunged 5.6% by the close on Friday, its biggest loss since July 2015 when a bubble was bursting in Chinese equities. Real estate companies suffered the brunt of the selling, with an industry gauge sinking the most since the global financial crisis, amid concern the city’s uncertain future will spur investors and residents to shift assets overseas.

At stake is whether the city can continue to operate effectively as a global financial center once Hong Kong passes laws curbing acts considered against China’s interests, such as sedition and subversion. The legislation was introduced in Beijing on Friday during the annual National People’s Congress, triggering calls in Hong Kong for renewed protests to safeguard local freedoms.

The surprise move by the Communist Party also risks exacerbating tensions with the U.S., and destabilizing global markets still reeling from economic fallout of the coronavirus pandemic. U.S. President Donald Trump, when asked about China’s moves, pledged to respond “very strongly.”

The stock selloff was widespread in Hong Kong, with more than two-thirds of the Hang Seng index’s 50 members setting new four-week lows on Friday. The MSCI Hong Kong Index was headed for its worst slide since 2008. The gauge, which includes two U.S.-listed shares, was trading at its lowest level since 2008 relative to MSCI Inc.’s global index.

Mainland-based investors have been on a 33-week buying spree in Hong Kong, even as the city’s stocks lagged those onshore. They purchased another net $569 million of the shares on Friday -- the most in two months -- undeterred by a 40% surge in the Hang Seng’s version of the VIX Index. Single-day volatility spikes of that magnitude had only happened five times prior in Hong Kong’s stock market.

The Hong Kong dollar weakened for a second day after hovering near the strongest it can trade versus the greenback for two months. Signs of nervousness showed in the options market, with volume on Hong Kong dollar derivatives at one point surpassing those on the yen. The currency’s 12-month forward points were set for the highest close since 1999, reflecting increasing demand to hedge against depreciation.

The nervousness bled into global markets, with U.S. stock-index futures dropping 0.5% as of 5:36 a.m. New York time and the MSCI Asia Pacific Index slumping 2%. Investors sought safety in the greenback and yen.

Hong Kong had failed to pass national security legislation since the U.K. handed the city back to China in 1997. The last time the local government attempted to introduce such laws in 2003 it triggered such widespread protests the bill was shelved.

After demonstrations last year over plans to make it easier to extradite residents to mainland China morphed into the worst unrest in decades, Party officials clearly decided the time for patience was over.

While the timing may make sense in Beijing, it could hardly come at a worse time for Hong Kong businesses. The economy is in tatters after last year’s protests and the coronavirus squeezed spending and curbed the flow of tourists and business travelers into the city.

What seems certain is Hong Kong will continue its transformation into a financial center for Chinese companies to raise funds and do business globally. Intensifying scrutiny from U.S. exchanges is likely to spur a flood of share sales in Hong Kong by mainland companies unworried about national security laws or unrest -- Alibaba Group Holding Ltd. sold shares in the city last November during the height of anti-government protests.

©2020 Bloomberg L.P.