A Cook County judge said Friday he will wait until jury selection to determine if a fair jury can be picked for Chicago police Officer Jason Van Dyke, putting off a decision on whether his trial should be moved because of extensive publicity until then.

The unexpected ruling by Judge Vincent Gaughan came after an all-day hearing at which experts for the defense and prosecution sparred — and lawyers argued — over the issue for nearly six hours.

The decision suggests that Gaughan would consider moving the trial if he found it impossible to find unbiased jurors when the jury selection is set to begin on Sept. 5, though he expressed confidence Friday that fair-minded jurors would be found.

What remains unclear, though, is whether there might even be a jury trial because Van Dyke’s legal team has not publicly announced yet if a jury of his peers will decide his fate or that decision will be left in Gaughan’s hands.

Opting for a jury would go against longtime precedent at the Leighton Criminal Court Building, where most police officers over the years have had judges hear their trials.

The veteran officer is charged with first-degree murder in the fatal shooting of 17-year-old Laquan McDonald.

Some veteran lawyers have speculated that the defense was pushing to move the trial as a strategic way to strengthen any potential appeal if Van Dyke was ultimately convicted. If Gaughan denied the change of venue outright and later found Van Dyke guilty, the defense could potentially point to evidence of jury bias in an appeal to a higher court, saying they were effectively forced to take a bench trial. Gaughan’s decision Friday would seem to blunt that potential strategy, however.

Gaughan had earlier tipped his confidence in finding a fair jury in Cook County during testimony by Bryan Edelman, a consultant hired by the defense as an expert on the issue.

The best way to determine potential jurors’ impartiality, Gaughan said, would be to question them in person to screen out bias — a process known legally as voir dire.

“My experience with the voir dire questions has been outstanding,” Gaughan said. “When you get in that room, and it’s face to face with intelligent lawyers, nobody’s going to get away with (bias).”

The bulk of Friday’s hearing was taken up by testimony from Edelman, who said his research showed news media coverage of McDonald’s fatal shooting has so saturated Cook County that Van Dyke cannot receive a fair trial here.

“The defendant is in a position where he would have to prove his innocence,” Edelman, who holds a doctorate degree in social psychology, said over the course of about four hours of questioning.

Van Dyke’s attorneys played in court an excerpt from the “16 Shots” music video by local rapper and songwriter Vic Mensa, as well as a campaign ad from now-State’s Attorney Kim Foxx in an attempt to show how pervasive the shooting has become in the county’s consciousness.

Van Dyke hunched over the defense table with his brow furrowed as attorneys played the Mensa video as well as footage of the officer walking into the Leighton Criminal Court Building followed by crowds shouting “16 shots and a cover-up.”

Video from a police dashboard camera — released by court order on the same day Van Dyke was charged with first-degree murder in November 2015 — showed Van Dyke shooting McDonald 16 times as the black teen walked away from police, contradicting officers' reports that McDonald had lunged at police with a knife.

On Friday, special prosecutor Joseph McMahon’s team opposed moving the trial from Chicago, saying the sheer size of Cook County assures a large enough pool of unbiased potential jurors.

While polling done by the prosecution found just 21 percent of adults in the county had not heard of the hot-button case, prosecution expert Katharina Castaneda, who also holds a doctorate in social psychology, testified that still added up to more than 830,000 people who could be impartial jurors.

Though awareness of the case is relatively higher in Cook County, the actual number of potentially unbiased jurors is still higher than in other counties surveyed, said Castaneda, who helped conduct online surveys in six Illinois counties in addition to Cook.

Castaneda and her team surveyed more than 750 people in Cook County via an online poll, plus about 200 in each of the other counties, she testified. Some 86 percent of the Cook County respondents said they had not heard of the case, had not decided on Van Dyke’s guilt or could put aside their decision on his guilt to make a decision purely on evidence, she said.

People often give more honest responses in online surveys, Castaneda said, because they sometimes don’t want to come off as biased before a live interviewer.

Edelman, called back to the witness stand, testified that Castaneda’s polling was deeply flawed, particularly since respondents were not randomly selected but rather took the survey in exchangefor a small amount of cash.

In an unorthodox move last month, Daniel Herbert, Van Dyke’s lead lawyer, sought to have another judge decide if the trial should be moved, arguing that Gaughan had already made it clear he was opposed to the request for a change of venue.

But earlier this week, Presiding Judge LeRoy Martin Jr. ruled that Illinois law doesn't allow a different judge to be brought in to decide only one pretrial issue — and that even if it did, Herbert's arguments of bias on Gaughan’s part weren't persuasive.

Edelman’s evaluation took months to complete and included hundreds of examples of the coverage the case has received since the video’s release spurred widespread protests, the ouster of the police superintendent, the electoral defeat of State's Attorney Anita Alvarez and a damning report by the U.S. Department of Justice.

The defense said a telephone survey was conducted of 399 jury-eligible Cook County residents and that 86 percent were familiar with the case. Three-quarters of those believed Van Dyke was guilty of murder, according to the survey.

The defense motion said the graphic video of McDonald’s shooting had been viewed more than 4 million times on YouTube.

Such motions for a change of venue are rarely granted, though. But two of the most high-profile murder cases in modern Cook County history are exceptions. Richard Speck, who was convicted of killing eight student nurses in a town home on Chicago's Southeast Side, had his trial moved to downstate Peoria half a century ago. And jurors for the 1980 trial of John Wayne Gacy Jr., who was convicted of killing 33 young men and boys in the 1970s, were selected in Rockford, but the trial was held in Chicago.