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.

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.