From Wednesday all residents in the densely packed city of 7.5 million must wear masks when they leave their homes while restaurants can only serve take-out meals.

No more than two people from different households can gather in public with fines of up to $HK5,000 ($625) for those who breach the new emergency rules.

The latest measures are a bid to stifle a sudden spike in coronavirus cases that have upended the city's otherwise enviable battle against the deadly disease.

More than 1,000 infections have been confirmed since early July -- more than 40 percent of the total since the virus first hit the city in late January.

New daily infections have been above 100 for the last six days.

"We are on the verge of a large-scale community outbreak, which may lead to a collapse of our hospital system and cost lives, especially of the elderly," chief executive Carrie Lam said in a statement released on Wednesday to coincide with the new measures.

"In order to protect our loved ones, our healthcare staff and Hong Kong, I appeal to you to follow strictly the social distancing measures and stay at home as far as possible," she added.

Hong Kong was one of the first places hit by the coronavirus when it emerged from China at the start of the year.

It initially had remarkable success in controlling the outbreak -- helped in part by a health-conscious public embracing face masks and an efficient track and trace programme, forged in the fires of the deadly SARS virus in 2003.

By June local transmission had all but ended.

But the virus later snuck back into the city and began spreading.

Health officials have been scrambling to uncover the source of the latest outbreak.

Some have blamed exemptions from the usual 14-day quarantine which the government granted to "essential personnel", including cross-boundary truckers, air and sea crew and some manufacturing executives.

The government has since tightened restrictions for some of those groups.

It has also announced plans to build a temporary 2,000-bed field hospital near the airport, something Chinese authorities have offered to help with.

The latest lockdown measures are a new body blow for a city that was already mired in recession thanks to the US-China trade war and last year's months of political unrest.

jta/je