Hundreds of people attended a rally the next day to protest the officer’s actions.

Officer Bernot could not be reached for comment on Saturday, but the Lancaster City Bureau of Police described in a statement what happened in the moments before.

Image Danene Sorace, the mayor of Lancaster, Pa., addressing her constituents on Facebook on the day that Sean Williams was shot by a Taser. Credit... via Reuters

Officers stopped Mr. Williams after receiving a 911 call about a man with a baseball bat, the police said. When one of the officers arrived, there was no bat to be found, but the officer saw three people telling Mr. Williams to get away from them, the statement said.

The officer told Mr. Williams “several times” to sit down and he refused to comply, the police said. Instead, he kept asking a woman in the group to give back his Social Security card.

A couple of minutes later, Officer Bernot arrived and instructed Mr. Williams to sit on the curb, the police said. The group of people later told the police that Mr. Williams had exhibited “erratic behavior” and “wanted to fight.”

The police said Mr. Williams was found to have an outstanding criminal warrant for possession of a controlled substance and public drunkenness. He was arraigned and released on $5,000 bail.

One of Mr. Williams’s lawyers, Brian R. Mildenberg, said on Saturday that it was “outrageous” Officer Bernot would not be “removed from the streets” pending an investigation, and that the commands Mr. Williams received from the officers were inconsistent.

“On behalf of my client, I reiterate our respectful demand that this police officer be suspended pending this investigation,” Mr. Mildenberg said. “He was completely peaceful and compliant and there was absolutely no reason to use violence upon his person.”