Hong Kong's government on Thursday reversed a day-old ban on restaurants serving dine-in customers -- introduced to control the spread of coronavirus -- following widespread public anger.

All restaurants in the city of 7.5 million were ordered Wednesday to only serve takeaways as part of a raft of ramped-up social distancing measures aimed at combating a fresh wave of virus cases.

But social media was quickly swamped by photos of primarily blue-collar workers forced to eat on pavements and parks -- and even inside public toilets to escape a torrential downpour.

Restaurant groups with links to influential pro-Beijing parties also voiced dismay at the measures, which had been urged by epidemiologists to slow infections.

On Thursday city authorities published new guidelines saying restaurants could operate dine-in facilities -- but only during the day, at half capacity, and with no more than two people to a table.

In the evenings they must stick to only serving takeaway meals.

In a statement, the government said the suspension of dine-in meals had brought "inconvenience and difficulties".

Hong Kong had been a poster child for tackling the virus, with local transmissions all but ended by early summer.

A man eats a takeaway meal outside a restaurant in Sham Shui Po, Hong Kong, after the dine-in ban was introduced
A man eats a takeaway meal outside a restaurant in Sham Shui Po, Hong Kong, after the dine-in ban was introduced AFP / ANTHONY WALLACE

But the virus has returned in recent weeks, brought in by tens of thousands of people who were exempt from a mandatory quarantine imposed on most arrivals.

They included international ship and airline crews, as well as top businessmen and senior officials travelling to mainland China.

More than 1,500 new infections have been detected since the start of July -- half the total since the virus first hit the city in late January.

New daily infections have been above 100 for the past eight days, and the death toll has risen from seven to 24 in July.

Under current coronavirus measures, all Hong Kongers must now wear face masks when outdoors and no more than two people can gather in public.

Many businesses, including bars and gyms, have been shuttered for most of July, while businesses have been urged to let employees work from home.

Hong Kong has some of the world's smallest apartments -- and most expensive.

Some residents barely have a kitchen to cook in making them hugely reliant on cheap eateries.