Lockdown restrictions will not be eased if large parties and fights at beaches continue in Wales, the first minister has warned.
Videos on social media showed large crowds at Ogmore-by-Sea, Vale of Glamorgan, followed by violent clashes on Thursday evening.
Current travel restrictions are set to be lifted on 6 July.
But Mark Drakeford said if the behaviour continued he would "not be able to continue easing restrictions".
Leader of Vale of Glamorgan council Neil Moore called the scenes "disgraceful" and said those causing disorder showed a "complete disregard" for their own and the community's safety.
He added: "A major clean-up operation is now under way. The car park at Ogmore beach has been closed and will remain so until at least the beginning of next week."
Vicky Fry, who lives in Ogmore-by-Sea, said the police response was "appalling" and "very delayed".
"They should have done a little bit more for the residents and local people," she added.
Speaking to Gareth Lewis on BBC Radio Wales she said the party went on late into the night after the incident, adding it was not a one-off but an "ongoing thing" locals had to deal with.
South Wales Police said two men in their 20s had been detained following the fight in Ogmore-by-Sea at about 20:00 BST on Thursday.
Det Ch Insp Tom Moore said the scenes at the beach were "totally unacceptable" and the force was working to "identify those who were responsible".
"We believe that a large number of youths have travelled to the area from various areas of south Wales to become involved in serious, violent disorder," he said.
Mr Drakeford said the scenes "threaten the health of people in Wales and undermine the sacrifices the majority of people have made during this ongoing crisis".
It's been so peaceful the last few weeks at Ogmore By Sea. They open the car parks and mass brawls happen 🙈 what is going on! pic.twitter.com/xgPGLZMLMX— Kelly Holmes (@kellyjayholmes) June 25, 2020
But he said at a press conference that the "ugly actions" of a few people should not "cast a shadow" over the efforts made by the wider population.
South Wales Police and Crime Commissioner Alun Michael described it as a "contagion of stupidity" and said people were "completely ignoring the risk to public health".
Residents also reported crowds of people partying in Barry Island, and beaches in Swansea, with one describing it as a nightly "Spring Break" party on beaches near their home.
Deputy Minister for Economy and Transport Lee Waters said the scenes were the actions of a "bunch of drunked-up young people", but if it kept happening the Welsh Government would have to "look again at the lockdown rules".
In Wales, it is illegal to gather in large groups and people are advised not to travel outside of their local area because of the coronavirus pandemic. Social distancing measures also remain in place.
But on Thursday police, the council, and the RNLI had to respond after crowds gathered at Ogmore-by-Sea, as temperatures soared across Wales.
The force tweeted a plea to parents to "check where your children are" on Thursday evening after reports of "large numbers of young people" gathering on the coast.
The force said it was "aware of videos circulating on social media" and inquiries were ongoing.
'It's been building for days'
Ogmore resident Sue Francombe said the scenes at the beach on Thursday evening were "absolute carnage".
She added: "We've been in lockdown for weeks and then I couldn't believe what was happening.
"I've been here for 16 years and we've never had this before. I feel really angry and upset."
Gerald McCarthy, who lives above the beach, said it was "absolutely horrendous", with roads and side streets leading to the beach "utter chaos".
But he said the beach should not be closed as it was used by walkers and families in the daytime.
Another resident, who did not want to be named, said it had been "building for a few days" with more people heading to the beach, and by Thursday "a few hundred were drinking" on the seafront.
Porthcawl RNLI confirmed it had attended an incident on Thursday evening and "assisted 45 people who were trapped at the river mouth by the incoming tide".
The Welsh Ambulance Service said it had also been called.
Former Conservative leader in the Senedd, Andrew RT Davies, who is based in the Vale of Glamorgan, tweeted about "some pretty ugly scenes" on the beach.
Member of the Senedd Carwyn Jones, who represents the nearby Bridgend constituency, said he expected "beach closures are now needed for a while" following the incident.
South Wales Police said it broke up the crowds at the beach at about 20:00, with the council forced to close the car park.
But the police were called again to the beach at 22:50 after some of the earlier group returned.
The force said that while witnesses reported someone had been hurt, as of late Thursday evening, no victims had been identified or had come forward.
Det Ch Insp Moore said the force would be "doing everything we can to ensure there is no repeat of this behaviour".
#INVESTIGATION | We are investigating an incident of disorder which happened at Ogmore-by-Sea, @SWPValeofGlam yesterday evening.— South Wales Police (@swpolice) June 26, 2020
Groups of people descended on the area throughout the afternoon and evening which culminated in large-scale disorder. pic.twitter.com/PJYbaxeT6o
In a separate incident, Vale of Glamorgan council enforcement officers said they were faced with "a number of hostile and aggressive youths" tombstoning at Rhoose Point on Thursday night.
The officers tweeted the "behaviour was unacceptable" and it would be taking further action against the youths.
Speaking on BBC Radio Wales Breakfast, Mr Michael said it was "disappointing" scenes of packed beaches in England were now spreading to Wales.
He said that the issue was spreading via social media and there was a lot of confused messages on platforms, but not observing social distancing was putting "everybody at risk".
Responding to questions about why police did not stop people flocking to the beach before the fight, Mr Michael said there was a "difficult balance" to keep, but it was "not something where you could enforce your way out of it".
"The police will enforce if it is absolutely necessary, but that's the last resort if people don't use common sense," he said.
"We need people to use common sense and that has been the characteristic in south Wales throughout the pandemic to date. It seems to becoming a bit apart."
Under current coronavirus guidelines in Wales, people from two different households are able to meet outdoors, but must maintain social distancing.
As a guideline, people meeting outside should do so within five miles of their home - there is no restriction on the number of people at any one time, but getting together with members of more than one household at the same time is illegal.
On Thursday people were urged not to use public transport to get to beaches, due to the travel restrictions, and to keep trains and buses free for key workers.
But on Thursday evening, images appearing to show coaches leaving Barry Island were posted on social media, and people tweeted trains were crowded with people sitting on taped-off seats.
Transport for Wales said: "Yesterday [Thursday] as a result of an influx of non-essential travel to seaside locations we quickly had to arrange additional coaches, the decision to put on this additional transport was to ensure our essential travellers and key workers could still get to their destinations safely.
"We'd like to take this opportunity to remind people that public transport is for essential travel and where there are no other travel alternatives."
The first minister said repeated scenes of people breaching rules could have an impact on the Welsh Government's approach to easing the lockdown."If we were to see some scenes like that last night, continuing to happen and if they were a more general breakdown of the efforts that we all have made in that would inevitably have an impact on our ability to go on, lifting restrictions," he said.
Mr Waters said young people had become "very frustrated" after being compliant for a long time.
"You see the first bit of hot sun and out come the beers and a couple of idiots ruin it for others," he said.
"There are inevitably flare-ups, especially young men who have had too much to drink in hot weather behaving stupidly, but I don't think you can then draw the conclusion that [lockdown] is breaking down across Wales."