BALTIMORE - Jurors deliberated more than 16 hours over three days but still could not reach a verdict in the trial of the first officer to face prosecution in Freddie Gray's death, forcing an already-weary Baltimore to continue waiting for any resolution in a case that has strained this city for months.

On Wednesday afternoon, Judge Barry G. Williams declared a mistrial.

"You clearly have been diligent," he told jurors. "You are a hung jury."

Perhaps no outcome could have better represented the mood here. Residents are deeply divided about what led to and who should be held responsible for Gray's fatal neck injury while he was in police custody. On the day of his funeral in April, riots exploded in West Baltimore as the incident became a defining moment in the national movement protesting law enforcement's treatment of African Americans.

As news spread outside the courthouse, protesters immediately expressed dissatisfaction.

"They just declared a mistrial. That means justice has not been found," Kwame Rose shouted into a bullhorn, adding soon after: "Do not tell us to protest in peace."

"Indict, convict, send those killer cops to jail," a crowd of about two dozen chanted.

Moments later, a sheriff's deputy read a statement to people who largely ignored him that they were free to protest but could not use bullhorns or assemble in front of the courthouse. Three police helicopters soon buzzed overhead.

The gatherers continued to shout: "No justice, no peace."

The jury, which appeared to consist of seven black and five white members, failed to reach unanimity after hearing two weeks of passionate legal arguments and contradictory witness testimony, leaving prosecutors to decide whether to try Officer William G. Porter a second time.

In a statement, Gray's family said they had been told Porter would be prosecuted again - and, in the meantime, they pleaded with residents to stay patient.

"Once again, we are asking the public to remain calm," the family said. "If we are calm, you should be calm, too."

Warren Alperstein, a defense attorney and former Baltimore prosecutor, said the mistrial could upend prosecutors' plans to quickly try all six officers who have been charged. The driver of the police van, Officer Caesar R. Goodson Jr., is scheduled to go to trial Jan. 6.

"Officer Porter shifted blame to the van driver, Officer Goodson, in his testimony," Alperstein said. "The state had hoped to use Officer Porter's testimony against Goodson at his trial. With a case possibly pending against Porter, he could invoke his Fifth Amendment right not to testify."

In a statement posted on Twitter, Mayor Stephanie Rawlings-Blake asked residents to "respect the outcome of the judicial process."

"In the coming days, if some choose to demonstrate peacefully to express their opinion, that is their constitutional right," she wrote.

After the announcement, State's Attorney Marilyn Mosby hugged the prosecutors and quickly exited the courtroom, telling reporters with a smile that the gag order meant she could say nothing.

Nearly 20 sheriff's deputies soon assembled on the courthouse steps as a deputy warned the small group that it was assembled unlawfully.

Rose, the lead protester, was then handcuffed and taken away.

"We are worthless in this city" said Lee Patterson, 60, a protester who has been outside the courthouse. "They don't care about black lives."

Arthur B. Johnson, a demonstrator who has been outside the courthouse for the entire trial, agreed.

"Five more mistrials and it's going to be 1968 all over again," Johnson said, referring to the chaos that followed the Rev. Dr. Martin Luther King Jr.'s assassination.

How the larger community will react now is hard to predict. Baltimoreans had long anticipated and, in some cases, dreaded a verdict.

Many in Gray's West Baltimore neighborhood - known for its poverty, violence, and steadfast distrust of police - feared that if several or even just one officer were acquitted, more upheaval would inevitably follow.

Both Sandtown-Winchester and the corner of Pennsylvania and North - where a CVS was looted on live TV eight months ago - remained quiet in the moments after Wednesday's announcement.

Tessa Hill-Aston, president of the Baltimore City NAACP, said she expected Porter would to be convicted on at least some of the lesser charges.

"I'm frustrated and disappointed," Hill-Aston said. "If you ask for medical attention, seems to me you should get it."

She worried about the city's reaction, hoping the protests remain peaceful.

"I don't want to see anybody else locked up," Hill-Aston said. "I wouldn't want to see what happened to Freddie Gray happen to another African American male." In a city also contending this year with a record-high murder rate, government leaders have begged residents to stay calm.

The Police Department has banned officers from taking leave as schools canceled field trips, warned students not to participate in civil unrest, and told parents that youths who participate in "any form of violence" would be punished.

Gov. Larry Hogan - who noted Wednesday that he was monitoring the response - recently told city leaders that Maryland was "hoping for the best and preparing for the worst."

U.S. Rep. Elijah Cummings held a news conference pleading for peace, and Police Commissioner Kevin Davis, who seemed to be anticipating a backlash, issued a statement imploring his officers to defy the public's dismal expectations of their agency.

"We will serve as peacekeepers for those wishing to exercise their right to protest," Davis wrote. "We will protect homes, businesses, residents and police officers from harm and mayhem."

Gray, 25, was arrested April 12 after he spotted officers in his neighborhood and ran, triggering a pursuit.

After he was dragged to the police van, prosecutors say, his spine was nearly severed when he fell in the back of the wagon in which his hands and feet were shackled but he wore no seat belt.

It remains unclear precisely how Gray was injured, but medical experts on both sides of the case compared his injury to those suffered when someone dives headfirst into too-shallow water.

Attorneys called more than 20 witnesses, presented about 100 pieces of evidence, and made hours of impassioned arguments in their competing efforts to explain Porter's actions that day.

Prosecutors alleged that Porter, 26, disregarded his duty by not strapping Gray into the van while also failing to get him medical help when he asked for it and, at one point, said he couldn't breathe. At a police station, Gray was found unresponsive. He died a week later.