Spikes in coronavirus cases abroad should act as a warning to Britons who flout social distancing rules, Boris Johnson has said.
The PM said crowds on Bournemouth beach on Thursday suggested people needed to understand that "mingling too much" could set the UK back.
He said people in other countries had been "taking too many liberties with the guidance" as lockdown rules eased.
Ministers have warned UK beaches could be closed if infections rise.
A further 186 deaths of people who had tested positive for coronavirus in the UK were announced on Friday, with the total number to have died now standing at 43,414.
The latest figures, released by the Department for Health and Social Care, showed a further 1,006 people had tested positive for the virus.
Mr Johnson said people in some countries were "not observing social distancing".
"Some parts of the world - I won't name them - but have you have got spikes, really serious spikes in instances of the disease, so it's crucial that people understand that on 4 July we get this right, that we do this in a balanced way, and we recognise the risks," he said.
"You may think you are not going to get it, that you're immortal and invincible and so on - and very likely that's true if you are young person. But the bug you carry can kill elderly people particularly. It is still dangerous; the virus is still out there."
The prime minister was speaking after the World Health Organization said Europe had seen an increase in weekly cases of Covid-19 for the first time in months after restrictions were eased.
Concern has been expressed about people gathering around the UK during this week's heatwave, including street parties in London and Manchester, crowded beaches and celebrating Liverpool fans.
A Dorset MP estimated 500,000 people visited the county during Thursday alone, with reports of gridlocked roads, fights and overnight camping.
A "major incident" was declared on the beach as a "standby measure"- which Dorset Council later said was because of an increase in people visiting hospital A&E departments and gridlocked traffic stopping ambulances getting through.
And Sam Crowe, the council's director of public health, said he was concerned about the risk of coronavirus being transmitted in enclosed environments, such as trains, as visitors travelled to the county.
Dorset Chamber of Commerce chief executive Ian Girling partly blamed the scenes on "a worrying lack clarity from the government" and called for "stronger messaging" ahead of 4 July, when pubs and restaurants are allowed to reopen.
He said: "It would have been common sense to ask people to remain in their home counties while we recover from the crisis and to give places like Dorset time to prepare to welcome visitors back."
Environment Secretary George Eustice told BBC Breakfast people had "generally" observed current social distancing rules - keeping 2m apart from other households - and forcing beaches to close would not be the first course of action. But he said: "We just have to recognise yesterday was the hottest day of the year, incredibly hot, a lot of people had the same idea, they all went to the beach, and yes of course those scenes at Bournemouth are a matter for concern."
Now it's up to the public
The concern about people flocking to beaches comes at an important point in our fight against the virus. The UK has been seeing infections fall despite the easing of restrictions.
Six weeks ago when the prime minister announced the first steps out of lockdown the number of newly diagnosed infections was around 4,000 a day. Those numbers have fallen by three-quarters since - with 1,073 a day being recorded, on average, over the past week .
But a combination of warm weather and the further easing of restrictions on 4 July means we are at a crucial juncture.
Much is being left to the good judgement, common sense and personal responsibility of people.
Government experts believe with the testing and tracing system in place the virus can continue be suppressed - but only if the public plays its part.
A woman at Bournemouth beach on Thursday told the BBC: "Social distancing has gone out the window and obviously I think we are part of that because we are here from Hertfordshire today."
Jane Martin, a palliative care nurse from Wimbourne, Dorset, said heavy traffic had made it difficult for her to visit patients. "It took me six-and-a-half hours to only get to three clients who are vulnerable."
Council leader Vikki Slade said there had been problems in Bournemouth since lockdown first eased in May, with people towards the beaches and pier. because pubs, bars and restaurants were still closed.
Tobias Ellwood, MP for Bournemouth East, added his voice to those saying the beach should have been shut.
"If we're going to be serious about tackling this pandemic then we need to be swifter in being able to provide support to local authorities that are unable to cope," he said.
Thursday was the UK's hottest day of the year so far, with highs of 33.3C (92F) at Heathrow Airport.
Bournemouth reached 30C (86F) and Brighton, which also saw busy scenes, hit 29C (84.2F).
In Wales, First Minister Mark Drakeford warned lockdown restrictions would not be eased if parties and fights at beaches continued.
Meanwhile, after crowds flocked to Liverpool's Anfield stadium when they became Premier League champions, Mayor Joe Anderson said the city would have to wait and see whether the gathering would cause a spike in coronavirus cases.
And the Met Police warned it would be placing a "particular focus on spontaneous unlawful music events that often attract large crowds" and were "flouting the health regulations" this weekend. It comes after police were attacked while attempting to disperse crowds at an illegal party for a second night.
Temperatures around the UK remained above 25C in south-east England on Friday, but were considerably lower in other areas, with thunderstorms forecast for many parts.
Who has the power to close beaches?
Health Secretary Matt Hancock is probably right to say that the government has the power to close beaches to prevent infection.
He might try to use schedule 22 of the Coronavirus Act 2020, which gives him the power to prohibit gatherings and close premises in England and Wales. The definition of a premises is very broad, so it could probably include beaches.
Alternatively, section 45C of the Public Health (Control of Disease) Act 1984 gives ministers broad powers to do what the government considers to be necessary in response to a threat to public health, including stopping people gathering.
The challenge for closing beaches is probably more of a practical one. The leaders of Bournemouth and Sefton councils told BBC Breakfast that they do not have the powers to close their beaches and that they would struggle to do so, having 15 and 22 miles of coastline respectively.
"It's not like a private beach at the end of a road that you could shut the road off," Vikki Slade from Bournemouth Council said. "People are living right down by the sand so that just isn't practical."
- RETHINKING LIFE AFTER LOCKDOWN: Jarvis Cocker and others discuss how life should change
- 'MORE IMPORTANT THAN ANY GAME OF FOOTBALL': How Rashford became a national hero in lockdown