BERKELEY (CBS SF) — A 25-year-old Oakland man was arrested after allegedly exposing himself to women and a child in Berkeley on Friday and then swinging a metal pole at a police officer who tried to detain him.

Joshua Frederick Wilson was arrested after officers responded at 7:43 p.m. to the 2900 block of Seventh Street on a report that a man had exposed his genitals to two women with an 8-year-old in front of a children’s play center, police spokesman Officer Byron White said.

READ MORE: Hertl’s Hat Trick Leads Sharks Past Flames, 5-3

An officer later found Wilson in the area of Seventh and Potter streets and he was carrying a metal pole. When the officer tried to detain him, Wilson allegedly swung the pole at the officer, narrowly missing the officer’s head, police said.

READ MORE: COVID: High Demand For Vaccines, Boosters Strains Staffing At San Mateo Clinic

Wilson allegedly ran away but was eventually captured a few blocks away and was arrested on suspicion of indecent exposure, annoying/molesting a minor, assault with a deadly weapon on an officer, and resisting arrest, according to police.

MORE NEWS: Firm Once Owned By 'Pharma Bro' Shkreli To Pay $40 Million To Settle Price Gouging Lawsuit

© Copyright 2019 CBS Broadcasting Inc. and Bay City News Service. All Rights Reserved. This material may not be published, broadcast, rewritten or redistributed.