Adding to the tension over the case was how drawn out it has been. The shooting took place in 2011, although Jennifer Joyce, then the city’s top prosecutor, brought the case nearly five years later, citing new, unspecified evidence. And the trial itself ended last month, but the judge in the bench trial, Timothy Wilson, of the St. Louis Circuit, waited close to a month to announce his decision. After the verdict, several school districts in the St. Louis area announced early dismissals and canceled weekend activities.

Image Jason Stockley Credit... St. Louis Police Department, via Associated Press

Mr. Stockley’s acquittal is the latest example of just how challenging it is for prosecutors to pursue criminal charges against police officers for shooting civilians. In recent months, officers were acquitted in jury trials in Oklahoma, Minnesota and Wisconsin. And in Ohio, prosecutors dropped a murder case against a former University of Cincinnati officer after juries twice failed to reach a verdict.

Kimberly Gardner, the elected prosecutor for St. Louis, said in a statement after Friday’s verdict that it was “extremely difficult to prevail in court” in such cases, but that she believed “we offered sufficient evidence that proved beyond a reasonable doubt that Jason Stockley intended to kill Mr. Smith.”

“Of course, I’m disappointed with the court’s decision,” Ms. Gardner said.

Neil Bruntrager, a lawyer for Mr. Stockley, said he appreciated the judge’s verdict and that “anyone who reads it will understand that Jason Stockley did nothing illegal.” He said his client was “relieved to finally have this done.”

At the trial in August, prosecutors described Mr. Stockley as an out-of-control officer who chased Mr. Smith for three miles at speeds of more than 80 miles an hour, shot him without provocation and then planted a .38-caliber revolver in Mr. Smith’s car. The shooting was premeditated, prosecutors argued, pointing to a recording device inside the police car that had captured Mr. Stockley saying to his partner, not long before the shooting: “Going to kill this” person, he said using an expletive, “don’t you know it.”

Judge Wilson said in his ruling that people “say all kinds of things in the heat of the moment,” and that the statement “can be ambiguous depending on the context.”

The defense argued that Mr. Stockley acted reasonably in fatally shooting a suspect in a drug deal that the officer had tried to stop before the car chase took place. Defense lawyers have said that the officer believed Mr. Smith was armed, and was reaching for a gun — the weapon that was found in his car after the shooting. Mr. Smith was shot five times.