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 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."

BALTIMORE-POLICE/

Deputies from Baltimore City Sheriff's Office stand outside the courthouse after a mistrial was declared in the trial of William Porter. (Bryan Woolston/Reuters)

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 totalling 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.

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."

At least two activists were arrested Wednesday.

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

freddie gray

Freddie Gray, 25, was arrested for possessing a switchblade knife outside a housing project on Baltimore's west side. (Family photo/Murphy, Falcon & Murphy)

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 defence 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.

BALTIMORE-POLICE/

Protesters march at city hall in Baltimore after a mistrial was declared in the case of Baltimore police Officer William Porter. (Bryan Woolston/Reuters)