The prime minister has backed an authority which took action against a festival over Covid-19 fears.
The Vegan Camp Out had been expected to attract about 1,000 people to Derbyshire on 25 and 26 September.
Mounting opposition led organisers to cancel the festival but concern over unofficial attendees saw the county council issue a prohibition notice.
In parliament, Boris Johnson said it was important councils knew they did have the powers to stop such events.
The celebration of veganism had been due to be held at Riddings Wood Caravan Park near Alfreton.
Dozens of letters of objection had been sent and the county's director of public health said it posed "a significant health risk".
However, Amber Valley Borough Council had said it could not use coronavirus as a reason to block the festival as public health was beyond its remit.
It had been due to debate the matter at a virtual meeting on Tuesday but the application was withdrawn shortly before.
Covid-19 restrictions brought in on Monday limit gatherings to six people.
Paul Smith, borough and county councillor for the area, said: "We weren't able to deal with the issue around Covid with the current licensing legislation and something needs to be done about that.
"Times have changed and public health and Covid need to be taken into account."
During Prime Minister's Questions, Nigel Mills, Conservative MP for Amber Valley, raised the matter of halting such gatherings.
Mr Johnson said it was an "important question".
He added: "It illuminates a question councils are asking themselves and I wish to confirm very strongly that they do have the power to stop such events in the interest of public health and they have taken the right decision."
Barry Lewis, county council leader, said: "We have been clear from the outset that this event should not go ahead.
"Whilst recognising that the organiser has withdrawn the licence applications we cannot take the risk that any gathering which does not have the proper measures in place will go ahead, hence serving the prohibition notices."
Festival organisers did not respond to an approach for comment.