Tens of thousands of protesters had gathered peacefully in the Chinese-ruled city to protest against the extradition bill.

But as tempers flared, riot police fired multiple volleys of tear gas at demonstrators who threw plastic bottles in running battles outside the city's legislature.

Some businesses shut and workers walked out on strike, a rarity in Hong Kong, to support the protest.

The benchmark Hang Seng Index closed 1.7% lower, having lost as much as 2% in afternoon, while Chinese companies in Hong Kong ended down 1.2%.

That compared with losses of less than 0.6% in Shanghai and Asia ex-Japan.

The selloff came amid broader concerns about the global economy due to fears that the Sino-U.S. trade war could be prolonged.

Ben Kwong, director of research at KGI said stocks were due to give up some gains following their strong performance in recent sessions and the clashes on the streets provided the impulse to sell.

"This is a normal initial reaction, when you have social unrest or tension, given that we've had a few years of relative calm," he said.

But it also sent financial institutions scrambling for liquid assets with interbank interest rates in the city shooting up across the curve. One-month and two-month HIBOR reached their highest since late 2008, while the one-week tenor jumped 87 basis points.

A Hong Kong Monetary Authority spokesperson told Reuters "the banking system of Hong Kong is safe and sound. Local banks are well capitalized and highly liquid. Their asset quality is good and their operations are strong."

Both the Hong Kong dollar currency market and the money markets were operating in an orderly manner, the spokesperson said in an emailed statement.

As a result of the higher interbank rates, the Hong Kong dollar rose as much as 0.2% to its strongest since last December. It was last seen at 7.8250 per U.S. dollar.

The Hong Kong dollar is pegged to the U.S. dollar at a range of 7.75-7.85. Official interest rates in Hong Kong usually move in lockstep with the Fed.

Interest rates are usually higher and liquidity tight during the mid-year dividend season and when there are large listings in the local stock market.

But two forex analysts based in the city said the protests added pressure, heightening concerns about capital outflows.

"This time around, people are really concerned about political risks, worried about foreign capital leaving Hong Kong," said one of the analysts, who asked not to be named.

In September 2014, when the 79-day pro-democracy "Occupy" protests erupted, the local currency and stock market weakened initially but rebounded in the following month, while the HIBOR curve sat below 1%.

Back then, however, global growth was strong enough for the Fed to hike rates and move away from interest rates that were near zero percent. This year, markets expect the Fed to cut rates amid concerns over growth and intensifying trade tensions.

The aggregate balance, a gauge of interbank liquidity, stood at HK$54.4 billion ($6.95 billion) on Wednesday, compared with over HK$239 billion in September 2014.

As such, local markets may react differently to the social unrest given the risks of lower rates locally, said Alex Wong, director at Ample Finance in Hong Kong.

"The impact was short lived in the past. But now we're in bear market. Sentiment was not good before this," he said.

Fitch affirmed Hong Kong's AA+ credit rating on Wednesday, citing strong public finances and resilient economy.

But the rating could come under review if there is "a move towards greater alignment of institutional and regulatory frameworks that diminish the autonomy of Hong Kong with respect to the factors that support its higher credit rating relative to mainland China," the agency said, commenting on the extradition bill.

(Additional Reporting by Alison Lui; Editing by Sam Holmes & Simon Cameron-Moore)

By Noah Sin