The Associated Press

BALTIMORE — Despite the days of riots, protests and a multimillion-dollar settlement that followed the death of Freddie Gray, a fair trial can be held in Baltimore for the six officers charged in Gray's arrest and death, a judge ruled Thursday.

While the decision may be a blow to defense attorneys, the judge left open the possibility of revisiting his ruling if they cannot find impartial jurors who have not been influenced by coverage of the case. Legal experts say it's likely the defense will continue to ask for the trials to be moved outside of the city.

Related feature Protests, charges against Baltimore cops after in-custody death The in-custody death of Freddie Gray led to weeks of protests — culminating in the deployment of the National Guard, charges for six officers involved in the arrest, and a probe of the Baltimore Police Department's practices.

Baltimore Circuit Judge Barry Williams said finding a place that hasn't been inundated by coverage would be nearly impossible.

"Information is ubiquitous, and every person in the city and state can choose to inundate themselves," Williams said.

Outside the courthouse, a group of about two dozen protesters cheered when they heard the ruling. They chanted: "The trial stays here."

One demonstrator was arrested as the hearing started.

Gray was a 25-year-old black man who died after being critically injured while in police custody in April. Prosecutors have said officers had no reason to stop or chase after Gray, and falsely accused him of having an illegal switchblade when in fact it was a legal pocketknife.

Gray was handcuffed, shackled at the legs and put in a van, and officers ignored his repeated pleas for medical attention, prosecutors have said. Gray died April 19, a week after his arrest.

His death prompted protests and rioting that shook the city and caused millions of dollars in damage, and has since come to symbolize the broken relationship between the police and the public in Baltimore, and the treatment of black men by police in America.

Attorney Ivan Bates, who argued on behalf of all six officers, said the city's $6.4 million settlement announced earlier this week influences prospective jurors and indicates "these officers are guilty, and if they are not guilty, why are we paying them $6.4 million?"

Mayor Stephanie Rawlings-Blake acknowledged the settlement before a trial was unusual, but she said it was important to help bring closure to Gray's family. Having the trials in Baltimore will help the city heal, she said.

Bates said prosecutors and city officials have painted a very inaccurate picture of what happened to Gray and urged city residents not to rush to judgment.

"We ask you to listen to the entire story, and we ask you to honestly figure out what happened in that van," he said.

Prosecutors said high-profile trials such as the Boston Marathon bomber and the D.C. sniper in Montgomery County, Maryland, were successfully held locally. The only circumstance under which a change of venue is appropriate is in "a small community where you have an armed lynch mob at the door," Chief Deputy State's Attorney Michael Schatzow said.

In his argument, Schatzow said the riots were "confined to a relatively small geographic area" and not widespread enough to affect all Baltimore residents.

Andrew Levy, a Baltimore defense attorney and an adjunct professor at the University of Maryland School of Law, said a change of venue was unlikely at this early stage in the proceedings, but he said the defense might raise the issue again when they're questioning potential jurors. The judge said he would entertain those arguments at that time.

Picking a jury will be a challenge, Levy said, because while jurors may believe they can be impartial about a highly publicized case, they may also fear for their safety in the event of an acquittal.

"It's not just the concern that they've already formed an opinion in the case," Levy said. "In a way, they have a vested interest in the outcome."

Samuel Walker, a criminal justice professor at the University of Nebraska said it's hard to ignore the fact that this is the central event in the city since the spring.

"It's very likely that many people will have formed opinions. It's just a fact of life. I think keeping the door open for reconsideration is extremely important," he said.

Defense attorneys estimated the number of eligible jurors in the city at about 276,000.

The trials are tentatively scheduled to begin Oct. 13.

The six officers were indicted in May and face charges ranging from second-degree assault to second-degree murder.

All six officers, including Edward Nero and Garrett Miller, are charged with second-degree assault, misconduct in office and reckless endangerment. Lt. Brian Rice, Sgt. Alicia White and Officer William Porter also face a manslaughter charge, while Officer Caesar Goodson faces the most serious charge of all: second-degree "depraved-heart" murder.

Three of the officers are white. Three are black.

Copyright 2015 The Associated Press