LONDON — U.K. police will be given powers to enforce strict new rules about when people can leave their homes, Boris Johnson said Monday night as the government tries to halt the spread of the coronavirus.

British people will only be allowed out to shop for basic goods, to exercise once a day, to receive care or help a vulnerable person and to travel to essential work, the U.K. prime minister said during an address to the nation from No. 10 Downing Street.

Police will be given powers to issue fines and disperse gatherings, he added.

While other countries have brought in more draconian measures, the prime minister has until now appeared reluctant to restrict people’s lives, insisting the U.K. is behind some other European countries when it comes to the spread of the disease.

Johnson was under increasing pressure from across the political spectrum to bring in and enforce stricter rules amid signs the U.K. government's "social distancing" guidelines were not working.

So far 335 people have died from the disease in the U.K., with the number of confirmed cases of coronavirus reaching 6,650 on Monday.

Thousands of people flocked to beaches, parks and other public places over the weekend, despite being told last week to keep 2 meters apart.

The rising death toll in other European countries, including in Italy, where health services have been overwhelmed, also appears to have persuaded the prime minister to act.

"Without a huge national effort to halt the growth of this virus, there will come a moment when no health service in the world could possibly cope because there won’t be enough ventilators, enough intensive care beds, enough doctors and nurses," he said.

"As we have seen elsewhere, in other countries that also have fantastic health care systems, that is the moment of real danger," he added.

So far 335 people have died from the disease in the U.K., with the number of confirmed cases of the coronavirus reaching 6,650 on Monday.

All shops selling nonessential goods, libraries, playgrounds, outdoor gyms and places of worship will now close, Johnson said Monday, and people will not be allowed to gather in public in groups of more than two. All social events including weddings, baptisms and other ceremonies will be stopped, apart from funerals.

Shortly after Johnson's address to the nation from Downing Street, Scottish First Minister Nicola Sturgeon and Welsh First Minister Mark Drakeford announced similar restrictions would come into force in Scotland and Wales.

Opposition Labour Party leader Jeremy Corbyn welcomed the new measures, saying it is the "right response to the coronavirus pandemic." He called for "clear guidance" to employers and workers about which workplaces should close.

The restrictions will be kept under "constant review," Johnson said, and would be relaxed in three weeks' time if the evidence allows.

"In this fight, we can be in no doubt that each and every one of us is directly enlisted. Each and every one of us is now obliged to join together to halt the spread of this disease to protect our NHS and to save many, many thousands of lives," he said.