A judge on Thursday found the sole officer charged with murder in the death of Freddie Gray not guilty of all counts, leaving prosecutors without a conviction for the third time in the high-profile case that spurred riots and unrest in the city last year.

The verdict in the trial of Caesar Goodson Jr. is the second acquittal handed down by Baltimore Circuit Court Judge Barry G. Williams in the case. The judge last month acquitted the second officer who went to trial in Gray’s death. The first officer’s trial ended in a hung jury.

Goodson, 46, drove the van that transported Gray through West Baltimore the morning of April 12, 2015, when the 25-year-old was arrested. Gray suffered a severe neck injury in the back of the van and died a week later.

Gray’s death triggered demonstrations and looting in the city as the nation was already mired in a fevered debate over fatal police encounters involving young black men. The mayor imposed a citywide curfew, and the governor called in the National Guard amid the riots.

Six Baltimore police officers were charged after Freddie Gray’s death and arrest. Here’s who they are. (Claritza Jimenez,Erin Patrick O'Connor/The Washington Post)

Over and over again when reading his ruling Thursday, Williams said the state did not have evidence to prove Goodson acted criminally. Prosecutors did not show Goodson gave Gray a “rough ride,” that Goodson knew Gray needed immediate medical care or that Goodson meant to harm Gray by failing to put him in a seat belt.

“There has been no credible evidence presented at this trial that the defendant intended for any crime to happen,” Williams said.

State’s Attorney Marilyn Mosby and her team of prosecutors quickly and quietly marched out of the packed courtroom after Williams read the verdict. The subdued scene was a stark contrast to Mosby’s news conference on the steps of the city’s War Memorial days after Gray’s funeral, when she forcefully announced charges against six officers in the case and declared she had heard Baltimore’s “call for no justice, no peace.”

The verdict casts serious doubt as to whether prosecutors can win a conviction against the four officers awaiting trial, but Mosby is unlikely to drop the remaining cases, said Jeremy Eldridge, a Baltimore defense attorney who is not involved in the case.

“Mosby made this part of her political agenda,” Eldridge said. “She made promises to the community about seeking out justice. What we’re seeing here is the complete unraveling of the state’s case that was laid out the day Mosby announced the charges.”

As Mosby hurried out of the courtroom Thursday, Goodson stayed. In a gray suit and purple tie, he exchanged handshakes and pats on the back with his attorneys and fellow officers while, nearby, his family embraced.

Events leading to Freddie Gray’s death, explained in augmented reality

A crowd of about 40 protesters who gathered outside the courthouse greeted the news of Goodson’s acquittal with disappointment and outrage.

Carl Dix, who grew up near Gray’s neighborhood, said the verdict has sapped his faith in the legal system.

“They’re saying you can go deaf, dumb and blind and say you didn’t know and get away with it,” Dix said. “To say that no one knew he needed any medical attention really means they can do anything to him.”

At a news conference Thursday evening, Gray family attorney Billy Murphy said the family continues to support Mosby and that they still “hope for justice.”

“This family is enormously frustrated not just for themselves but for the community,” Murphy said. Gray’s mother and stepfather stood with him but did not comment.

Goodson faced the most serious counts among the charged officers. He was acquitted of second-degree depraved-heart murder, second-degree assault, misconduct in office, reckless endangerment and three counts of manslaughter.

With more than 30 witnesses testifying over an eight-day trial, prosecutors attempted to convince Williams that Goodson was culpable in Gray’s death. As the van driver, prosecutors argued, Goodson had ultimate custody and care of Gray but failed to buckle Gray into the back of the police wagon and to get him immediate medical attention. They said Gray got a “rough ride,” bouncing around the back of the wagon without a seat belt but with his wrists and legs shackled.

Goodson’s attorneys countered that the officer’s decision not to enter the narrow van compartment and put a seat belt on Gray was reasonable because Gray was combative during his arrest. Gray did not say he was in pain or show signs of a medical emergency. And prosecutors did not have evidence of a “rough ride” or witnesses who saw Goodson driving erratically.

Lawyers were unable to comment on the verdict because a gag order is in place for the duration of the case.

Following Goodson’s acquittal, city Fraternal Order of Police President Gene Ryan said the group is pleased with the ruling and optimistic that the remaining officers will also be acquitted. He called on Mosby to drop the remaining charges.

“It is time to put this sad chapter behind us,” Ryan said.

Goodson remains suspended without pay and his case is under internal review by the department, a police spokesman said. Having been found not guilty, his pay will probably be reinstated.

As he announced the verdict, Williams hammered the state’s “rough ride” theory, calling it “an inflammatory term of art.”

“When uttered, it is not to be taken lightly for, at a minimum, it means there are actions and intent on the part of the individual driving the vehicle,” Williams said.

Williams said video and photos that prosecutors presented did not prove beyond a reasonable doubt that Goodson ran a stop sign or recklessly made a wide turn, as the state contended. Witnesses for the prosecution could not specifically define “rough ride.” And only when pressed in closing arguments did prosecutors say a rough ride could be inferred because Gray got hurt while unbuckled in the back of the van.

“The failure to seat-belt may have been a mistake, or it may have been bad judgment,” Williams said, “but without showing more than has been presented to the court concerning the failure to seat-belt and the surrounding circumstances, the state has failed to meet its burden.”

The judge also said competing testimony from at least four medical experts offered “equally plausible scenarios” as to when and where Gray was injured. And if experts disagreed, “how would the average person or officer without medical training know?”

Testimony showed that Gray told police at multiple stops that he wanted to go to the hospital. But according to the judge, there was no evidence until the van arrived at the final stop that Goodson realized Gray — who had a bloodied face and was unresponsive — was in medical distress.

To win the second-degree depraved-heart murder charge, prosecutors had to prove that Goodson’s actions or lack of actions created a very high risk to Gray’s life and that despite knowing the risks, Goodson acted “with extreme disregard of the life-endangering consequences.”

Defense attorney and former prosecutor Warren Alperstein, who is not involved in the case, said the state’s case crumbled in two places: its presentation of a “rough ride” theory and failure to show that Goodson breached his duty as an officer.

“The state made the ‘rough ride’ theory a centerpiece of its case, and when the ‘rough ride’ theory was not proven at all, a significant part of the state’s case fell apart,” Alperstein said. And if there was no bleeding, bruising or heavy breathing at earlier stops, “how could a reasonable officer know Freddie Gray was in need of medical help?”

University of Maryland law professor Doug Colbert said that though the state has yet to secure a conviction in the case, the trials have been good for the community.

“It is so important,” Colbert said, “that these public trials are held so that people can come to a courtroom and hear what happened to Freddie Gray and then make their own decision about whether that is the practice they want to embrace or whether it is time for significant changes.”

The city remained peaceful throughout the day. As the evening went on, a small gathering of people spoke out against the verdict at the corner of North and Pennsylvania avenues, the epicenter of last year’s riots. Nearby, a group of officers and kids played a game of pickup basketball.

Joe Heim contributed to this report.