The first effort to convict an officer in Freddie Gray's death from a broken neck in a Baltimore Police van ended Wednesday with a hung jury and a mistrial.

Officials appealed for calm as small crowds protested along streets lined with police officers. The situation was quiet at North and Pennsylvania, the intersection where the worst rioting happened in April as parts of West Baltimore were set on fire.

William Porter's mistrial is a setback for prosecutors trying to respond to a citizenry frustrated by violent crime and allegations of police misconduct. Homicides have soared and the pressure on city officials has been unrelenting since Baltimore City State's Attorney Marilyn Mosby charged six officers in Gray's death.

About 30 protesters chanting "send those killer cops to jail" outside the courthouse switched gears after the mistrial was announced, chanting "No justice, no peace!" and "Black Lives Matter."

The case hinged not on what Porter did, but what prosecutors said he didn't do. He was accused of failing to get medical help for a critically wounded Gray and was charged with manslaughter, assault, misconduct in office and reckless endangerment, carrying maximum sentences totaling 25 years.

The judge planned to discuss a possible retrial with both sides in his chambers on Thursday.

Mayor Stephanie Rawlings Blake and the new police commissioner she installed after last April's riots warned people against more violence.

"We will not, we cannot be defined by the unrest of the spring," the mayor said.

"Protesters who are lawfully assembled have a friend in the Baltimore Police Department," Commissioner Kevin Davis said. "Folks who choose to commit crimes and break things and hurt people are no longer protesters."

Mosby wouldn't comment: "Gag order," she said, smiling and shaking her head inside the courthouse.

Attorney Billy Murphy, who obtained a $6.4 million settlement for Gray's family from the city before Porter's trial, called the mistrial "a temporary bump on the road to justice."

The racially diverse jury of seven men and five women deliberated for about 16 hours over three days. They indicated they were deadlocked on Tuesday, but Circuit Judge Barry Williams told them to keep at it, even as he denied their requests for help.

"It is clear you will not come to a unanimous agreement on any of the four charges," the judge said Wednesday. "You have clearly been diligent."

The Baltimore NAACP asked people to control their "frustration and anger" and respect "the rights of all people respected, on all sides."

At least two activists were arrested, including Kwame Rose, a young black man who called the mistrial an "injustice."

"We are going to fight for justice until it becomes a reality in our lives. A mistrial means that the prosecution did not do their jobs good enough," he said.

Erika Alston, a West Baltimore community leader who founded Kids Safe Zone after the April riots, said she felt there was reasonable doubt that Porter committed manslaughter, but "it's early. It's one of six."

"I'm not expecting our community to repeat April, but it is a bit of a kick in the chest," she said.

Activist Duane "Shorty" Davis accused the prosecution of deliberately putting on a weak case to preserve its relationship with the police. "They're not going to eat their own," he said.

Porter left the courthouse after conferring solemnly with defense attorney Joseph Murtha, and was shielded by deputies from the media. Murtha declined to comment.

Gray was arrested while fleeing from officers and died April 19, a week after his neck was broken inside a police van as a seven-block trip to the station turned into a 45-minute journey around West Baltimore. The young black man had been left handcuffed and shackled but without a seatbelt in the metal compartment. The autopsy concluded that he probably couldn't brace himself whenever the van turned a corner or braked suddenly.

Porter is also black, as are two of the other five officers charged. Race was never mentioned during the trial.

It wasn't clear how the mistrial would affect the other officers. Prosecutors had planned to use Porter's testimony against two of them.

Prosecutors argued that Porter, who was present at five of the van's six stops, was criminally negligent for ignoring his department's policy requiring officers to seatbelt prisoners, and for not calling an ambulance even though Gray repeatedly said he needed medical help.

The defense said Porter went beyond the call of duty when he moved Gray to a seated position at one point, and told the van driver and a supervisor that Gray had said "yes" when asked if he needed to go to a hospital. The driver, Officer Caesar Goodson, is scheduled for trial on Jan. 6.