LANCASTER, Pa. (AP) — A Pennsylvania police officer is seen on video using a stun gun on a man as he’s sitting on a curb.

Lancaster police says officers were called around 10 a.m. Thursday and told a man was confronting people with a bat.

Video posted to Facebook captured Officer Philip Bernot telling 27-year-old Sean Williams to sit on a sidewalk and stick his legs out. Bernot then uses his stun gun on Williams while the man is sitting, facing away from the officer.

Police say Williams refused to comply with the officer’s commands. Williams tells WGAL-TV he followed all directions and doesn’t know why he was shocked.

Mayor Danene Sorace says she was upset by the video, and an investigation into the officer’s use of force is ongoing.