North Yorkshire Police said after midday on January 6, staff at Scarborough Justice Centre reported someone damaging a marked police vehicle on Northway outside Scarborough Magistrates' Court.
The suspect had just left the court building, having been there on an unrelated matter.
Officers attended and arrested a 17-year-old on suspicion of criminal damage.
A spokesman for North Yorkshire Police said: "He was charged with criminal damage yesterday evening (January 6).
Scarborough officially smashes temperature record as Met Office confirms new hottest day
Whitby Regatta 2022: Red Arrows unable to display over town as sea fret rolls in
RNLI issue weever fish warning for Yorkshire coast
Whitby Regatta 2022: 25 of the best photos as event goes ahead despite sea fret disruption
Post-war asbestos bungalows to be demolished in Scarborough as plans for new terraced homes approved
An Iveco police van and a Peugeot Partner van, used by crime scene investigators, were both damaged, with their passenger-side wing mirrors knocked off. Both vehicles will be out of action until they can be repaired.