Police stopped hundreds of ravers from attending a festival at a disused barracks.
A ten-day anti-capitalist carnival was advertised on the internet and on fliers being distributed in Brighton and Hove and London.
Police believed more than 500 ravers were headed for the former Preston Barracks, in Lewes Road, Brighton, for a free party on Saturday night.
More than 100 tonnes of earth and rubble was used to block the main entrance on Friday, to stop sound equipment being taken onto the land.
Squatters had occupied one of the buildings and decorated the inside for the advertised Space Invaders Festival of Arts and Resistance.
Organisers agreed to abandon the rave on Saturday after talks with police and officials from Brighton and Hove City Council, which owns the site.
Only about 30 revellers arrived for the event later in the day.
Inspector Steve Curry, of Brighton and Hove police, said: "We had people turning up from London, blissfully unaware the event had been cancelled. We had people trying to scale the fence trying to get in."
Police officers, some with dogs, were at the site all night.
Insp Curry said: "We were very lucky. We were very pleased with the early intervention, it was something that worked.
"There had been very great potential for serious public disorder, crime and social disorder."
The council took possession of the buildings when the squatters left.
Comments: Our rules
We want our comments to be a lively and valuable part of our community - a place where readers can debate and engage with the most important local issues. The ability to comment on our stories is a privilege, not a right, however, and that privilege may be withdrawn if it is abused or misused.
Please report any comments that break our rules.
Read the rules hereComments are closed on this article