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: Demonstration in Oakland to Protest Police Shootings Turns Violent

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: Armed Bike Thieves Targeting Cyclists in the East Bay Hills

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: COVID Vaccines: Contra Costa Drop-In Sites End Frustration Among Those Struggling To Find Appointments

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