A viral video posted on social media shows a white police officer using a stun gun on a seated black man, despite appearing to follow the officer's orders.

The video, which has garnered nearly 2 million views since being posted to Facebook on Thursday, shows Officer Philip Bernot apparently using a stun gun on 27-year-old Sean Williams in Lancaster, Pa., according to The Associated Press.

The AP reported that Lancaster police had received a call about a man confronting people with a bat.

ADVERTISEMENT

In the video, Bernot repeatedly asks Williams to sit on the curb and stretch his legs "straight out." Williams stretches his legs, though his knees are still slightly bent, to which an officer tells him "legs straight out or you’re getting tased."

A second officer can be hear saying “put your legs straight out and cross them now.”

Williams moves his legs out and then brings them closer to the curb. Bernot can then be seen using a taser aimed at Williams's back, causing him to writhe on the ground in pain.

According to the AP, police say Williams did not comply with their previous orders to sit on the ground. No bat was found on the scene and a group at the scene said they did not see Williams holding a bat, the local NBC affiliate reported.

Williams told the network that he doesn't know why he was tased.

Mayor Danene Sorace told Lancaster Online that she was upset by the incident and that an investigation into the officer's use of force is underway.

“Like you, when I saw the video I was upset by it and it is of great concern to me. We take the use of force very seriously,” Sorace said in a statement.

The incident comes as police departments around the nation face heightened scrutiny over their use of excessive force, particularly on black men.

Earlier this month, four Arizona police officers were placed on administrative leave after video captured officers repeatedly punching a man.

Lancaster Online reported that Williams had an outstanding criminal warrant for his arrest for charges of public drunkenness and possession of a controlled substance.

He was arraigned and released on unsecured $5,000 bail, according to the outlet.