Unruly youths pelted police with beer bottles and cans at an Oamaru party on Friday night.

Police said they arrested three youths at a party about 10pm for disorderly behaviour and obstruction, but as they left, other youths began throwing bottles and cans.

Police returned about half an hour later with reinforcements and arrested 19 more youths for assaulting police, obstructing police, resisting arrest, possession of cannabis and depositing dangerous litter.

Police said pepper spray was used on several of those arrested.