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: Dixie Fire Grows To 181,289 Acres; 19% Contained

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: Two Dead, Four Wounded In Downtown San Rafael Late Night Shooting

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: Massive Early Morning 3-Alarm Fire Destroys Oakland Warehouse

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