Two rival groups armed with knives, bats and knuckledusters had been planning an all-out brawl at Melbourne's White Night celebrations, police say.
Police on Sunday revealed they had been monitoring two groups of disaffected youths for weeks.
More Victoria News Videos
White Night Melbourne 2017 highlights
Revellers share their favourite moments of Melbourne's fifth White Night on social media.
On Saturday night, they arrested more than 20 people to prevent a repeat of the ugly scenes that marred last year's Moomba Festival and other recent public events.
Police also seized weapons, including a can of OC spray, as the angry teenagers arrived at Footscray train station in what officers described as a "picture perfect" operation.
Assistant Commissioner Stephen Leane said officers had prevented violence from erupting between the two groups and ruining the fun for the hundreds of thousands of people who attended the fifth instalment of the CBD's White Night event.Â
"We watched them all night. We talked to them all night. We engaged with them all night," Mr Leane said.
"Many of them were upset and telling police when they were leaving that it was boring. They were looking for something else."
But a small group remained behind and, at 2am, decided it was time to fight, he said.
Mounted branch and public order response team units were sent to the incident at Federation Square in which youths faced off.
One person was arrested and brought down with OC spray while police moved on the rest of the crowd.
A 17-year-old Dandenong North boy is expected to be charged on summons with possessing a dangerous article.
Â
Twitter user Michelle said she had left the area as tensions arose at Federation Square because it was "a bit scary".
Rob Bibby said it was concerning that the youths involved in the clash were dispersed towards the train station.
"The fact they just sent them home on trains is frightening," he tweeted. "So many families placed in unnecessary danger."
Mr Leane said the two groups were not from the Apex gang, a group that came to public prominence last year during the Moomba riot.
"I'm not sure Apex even still exists," he said.
"It still exists in the media ... but the young people have moved on talking about Apex, as far as we can work out."
Instead, he described the two groups of youths as being aged 14 to 19 and part of a loosely organised North-South or South-West rivalry comprised of many different ethnicities.
"They take a disliking to each other and, for some reason, the groups were deciding last night they'd have a go," he said.
Police were tipped off about the planned brawl via social media and community leaders, who were concerned about escalating tensions between the groups.
Police were happy with overall crowd behaviour, he said.Â
A total of 21 people were arrested for a range of offences, including drunkenness, drugs, assault, criminal damage and weapons offences.
Almost 600,000 people took to city streets for the fifth instalment of White Night Melbourne.
Police had earlier been kept busy at the Electric Parade dance music festival at the Sidney Myer Music Bowl, arresting 40 people on predominantly drug charges as paramedics took 21 people to hospital following drug overdoses.
In another incident a woman had her arm slashed with a knife in an attack by three teen girls at Southern Cross Station.Â