A judge ruled Thursday that six officers charged in the Freddie Gray case can get fair trials in the city despite intense media coverage, looting that shuttered businesses and a citywide curfew that kept residents in their homes.

The ruling could ultimately leave it up to six separate juries — 72 men and women — to decide what happened to Gray in the back of a Baltimore police van a week before his death on April 19. It also requires city leaders to continue bracing themselves for potential civil unrest with the announcement of each verdict in the coming months.

Thursday’s change-of-venue hearing brought demonstrators and national news media back to Baltimore one week after Circuit Court Judge Barry G. Williams decided that the six officers should have separate trials.

Defense attorneys requested that the trials be moved outside the city, arguing that seating six impartial juries in Baltimore would be impossible. But prosecutors said it was too soon to assume that the city’s nearly 300,000 eligible jurors wouldn’t be up to the task.

Williams agreed, and his decision drew jubilant cheers of “The trial stays here!” from demonstrators outside the courthouse.

The officers charged in the Freddie Gray Case are Caesar Goodson, Garrett Miller, Edward Nero, William Porter, Brian Rice and Alicia White. (Baltimore Police Department/European Pressphoto Agency)

Protest organizer Sharon Black said moving the trials would have been a “tragedy of injustice.”

“Who are true biased jurors?” Black asked. “They are not in Baltimore City. They are out of Baltimore City.”

Gray suffered a severe spinal injury after he was arrested April 12 and put in the back of a police van. The case stoked national debate over the deaths of young black men in police custody. In response to rioting that broke out after Gray’s funeral, authorities called in the National Guard and set a curfew for the city.

At Thursday’s hearing, defense attorney Ivan Bates argued that the case should be moved because all city residents felt the impact of April’s chaos in one way or another.

He also said the city’s decision this week to approve a $6.4 million settlement with Gray’s family would affect the jury pool. All potential jurors are city taxpayers, who would be footing the bill for the settlement, he said. And he argued that the settlement could leave the impression that the officers are guilty.

“In many ways,” Bates said, “we gave our officers a public trial.”

Prosecutors disagreed.

Undated family picture of Freddie Gray. (Baltimore Sun)

Michael Schatzow, the chief deputy state’s attorney for Baltimore City, said the settlement agreement isn’t the same as an admission of guilt or wrongdoing. It would be more appropriate, he said, to wait until the judge and attorneys could interview and screen potential jurors to decide whether the pool would be unfair.

“The notion that we should simply pick up and move and go somewhere else . . . is insulting to the citizenry of Baltimore,” Schatzow said.

After hearing about 30 minutes of arguments and combing through reams of statements and evidence from both sides, Williams sided with prosecutors. The defense didn’t meet the burden of proof required to move the case, the judge said.

“The citizens of Baltimore are not monolithic,” Williams said. “They think for themselves.”

Given round-the-clock news coverage, the Internet and social media, “information is ubiquitous” and it would be difficult to find a jurisdiction that hasn’t been permeated with details of the case, Williams said. But the appropriate time to determine whether a jury would be unbiased is during the selection process. Williams added that he would consider future requests to move the trials if necessary.

Judges elsewhere have moved high-profile criminal cases, but they don’t do so all the time.

In 1996, the trial for Oklahoma City bombing suspects Timothy McVeigh and Terry Nichols was moved to Denver. But this year, Boston Marathon bomber Dzhokhar Tsarnaev was tried in Boston despite attempts by his attorneys for a change of venue. The effort went to a federal appeals court, where two judges wrote that publicity of high-profile cases­ “does not equate to disqualifying prejudice,” according to the Boston Globe.

In the Washington area, Beltway snipers John Allen Muhammad and Lee Boyd Malvo were granted a change of venue for shootings that occurred in Northern Virginia, with the cases moved more than 100 miles away to the Virginia Beach area. But a judge in Montgomery County kept Mohammad’s trial in the local courthouse, and Malvo pleaded guilty there.

Assuming that none of the six officers elects a bench trial, in which a judge would determine guilt or innocence, the city would need to seat nearly 100 jurors — 12 for each case in addition to alternates.

Six officers have pleaded not guilty in the case: Officers Caesar R. Goodson Jr., William G. Porter, Edward M. Nero and Garrett E. Miller, Lt. Brian W. Rice and Sgt. Alicia D. White.

Porter, Rice and White have been charged with involuntary manslaughter and other related charges. Goodson, who drove the van carrying Gray, faces the most serious charges, including second-degree depraved-heart murder, involuntary manslaughter and other counts. All six officers are charged with second-degree assault, misconduct in office and reckless endangerment.

A trial date has been set for October, although it was unclear whether that would be pushed back.

Steve Silverman, who has been a defense attorney in Baltimore for 25 years and is not involved in the Gray case, disagreed with the judge’s decision. He said the jury pool, even before this week, was tainted for two main reasons: massive media coverage of the charges­ against the officers and social unrest over the notion that the officers might never be held accountable. Also, he said, the large settlement with the family could be seen as a message that the officers had done something wrong.

“Based on the mood of many of the citizens of Baltimore, keeping the trials here seems to be a tremendous advantage for the prosecutors,” Silverman said.

As the case moves forward, Silverman said he expects the defense attorneys to play up their clients’ connections to Baltimore, presenting the officers as people trying to make a difference by protecting their fellow citizens, such as those seated in the jury box. The message, according to Silverman: “This is a hardworking cop. [He] tries to do the right thing. This was an accident.”

That message emerged Thursday afternoon. After the hearing, attorneys for the officers gathered outside the courthouse with a statement on behalf of their clients.

“Each of the six officers went into their job because of a love for this city — our city — and a respect for the citizens,” Bates said. “The court had made its ruling and we respect that. So now we turn to the citizens of Baltimore City . . . and ask you to please be patient. We ask you to listen to the entire story.”

Dana Hedgpeth contributed to this report.