Four teenagers have been charged with assaulting police during a brawl at a Sydney beach overnight.

The fight started at Coogee Beach's Goldstein Reserve at 11pm (AEST) on Saturday.

The crowd became aggressive when two officers tried to intervene, police said.

It's alleged the police were assaulted during the fray and had to use capsicum spray on their attackers.

The police were treated at the scene for minor injuries.

A 17-year-old boy and three 16-year-olds have been charged with assaulting police in the execution of their duty and affray.

They'll appear in Bidura Children's court on October 1.