Judge Barry G. Williams during the six trials of officers accused in the death of Freddie Gray, Dec. 7, 2015 in Baltimore. (Richard Johnson/The Washington Post)

Judge Barry G. Williams is quick to roll his eyes when he hears flimsy logic. He abruptly cuts lawyers off mid-sentence if he senses snarkiness or rhetorical grandstanding. And he doesn’t hesitate to call out lawyers who repeat themselves, because, as he’ll remind them, “just because you say something twice, doesn’t make it true.”

After a decade in Baltimore City Circuit Court, Williams has developed a reputation as a judge with a command over the law and his courtroom — someone who is tough, fair and slightly impatient.

“He’s not going to let anyone push him over,” said Baltimore defense attorney and former city prosecutor John Cox. “He’s not going to let public opinion affect his belief system and what he is going to rule on. Everyone is going to get a fair trial, and he’s going to listen to both sides.”

Williams — who leaves out bowls of candy for jurors and clerks — starts every day with a bright “Good morning,” expecting a return chorus of the same from the crowd in court. He can offer a ready smile that can quickly turn stern if he is crossed.

Williams has been on the bench for the trial of Officer William G. Porter, the first of six officers to head to court over charges in the arrest and death of Freddie Gray, 25, who died after suffering a grave spinal injury while being transported in a police van. Closing arguments are expected Monday after eight days of testimony.

Prosecutors allege that Porter and the other officers involved in Gray’s arrest and transport failed to properly restrain Gray in the van and get him appropriate medical attention.

Having a confident judge known for running a tight courtroom is important in the Gray cases for several reasons. Any questionable ruling could lead not only to unfair trials for the officers, but also risks reigniting civil unrest if residents believe the verdicts are illegitimate. And intense media scrutiny could quickly turn the trials into a spectacle.

“The defense and prosecution know the entire country is watching them, and they’re trying to make arguments that they normally wouldn’t make,” said Roya Hanna, a former Baltimore prosecutor who now has a private practice. Williams is “trying to bring it back to what normally happens to not let this case take on a life of its own, even though it kind of has.”

Born in New Jersey, Williams, 53, graduated from the University of Virginia and the University of Maryland School of Law. After working as a law clerk, he was a Baltimore prosecutor for eight years before becoming a trial lawyer and special litigation counsel with the Civil Rights Division of the U.S. Justice Department.

Larry Gibson, one of Willams’s professors, said he remembers the judge as a “serious young student” who also had a good sense of humor.

“I’ve taught a lot of students in 40-some years, but he is memorable,” said Gibson, who taught Williams at the University of Virginia and is now a professor at the University of Maryland. “I’ve been following his career, and it would be difficult to find anyone with the range of experience better for handling this kind of case.”

Williams worked as a prosecutor when Jose F. Anderson, now a professor of law at the University of Baltimore, served as a public defender.

“He was not a prosecutor who had a reputation of playing fast and loose with the case or taking risks with discovery, things that could lead to a case being overturned,” Anderson said. “He has shown the same kind of care with the Freddie Gray case.”

As a judge, Williams has worked on several important trials, but none as high-profile as those in the Gray case. In 2009, Williams presided over a case in which he found that Maryland officials violated federal and local laws when they delayed providing food stamps and other public benefits to recipients. Williams had initially given the Maryland Department of Health Services a year to correct the problems. Officials complied within the year, but Williams still issued an injunction adding another two years of oversight to ensure continued progress.

Last year, Williams threatened to hold a Baltimore police detective in contempt of court when he was on the witness stand in a robbery case. The detective refused to disclose details of how police tracked the defendant, saying the police department had a “nondisclosure agreement” with the FBI about the phone-tracking device used in the investigation, according to the Baltimore Sun. To which Williams replied: “You don’t have a nondisclosure agreement with the court.” The detective declined to disclose the details, and prosecutors pulled the evidence from the trial.

“He runs a very disciplined courtroom,” said A. Dwight Pettit, a Baltimore-based defense attorney who often appears before Williams and tried a two-week-long murder trial before the judge three years ago.

“I had a rough case, and I knew it wasn’t going to be a winner,” Pettit said, “but he was a fair and stern judge.”

Attorneys in the Gray cases are prevented from discussing them because of a gag order imposed by Williams.

But several lawyers and legal observers not connected to the case have applauded many of the judge’s decisions thus far. Those decisions included ordering separate trials for the six officers charged and attempting to draw a fair and impartial jury in Baltimore before considering moving trials outside the city.

Defense attorneys had aggressively pursued a change of venue, saying there is no way their clients could receive a fair trial in the city. Jury selection in Porter’s case began Nov. 30, and a jury from Baltimore was seated.

Douglas Colbert, a professor with the University of Maryland, observed the first pretrial hearing and said he has been impressed with Williams’s knowledge and preparation.

“Too often, judges will shut down lawyers and make hasty rulings,” Colbert said. “I thought that Judge Williams permitted the necessary latitude for the lawyers to argue, and peppered the lawyer with questions and comments, but reached the point where he would let the lawyers know that his patience was being tested.”

During the first hearing before the start of any of the trials, defense attorneys argued that Baltimore City State’s Attorney Marilyn J. Mosby acted unethically by discussing whether officers charged in Gray’s death were cooperating with the investigation.

Michael Schatzow, Mosby’s second in command and one of the pair of prosecutors who have handled the Porter trial, conceded that perhaps some of her comments were unnecessary. But Williams had a sharper take.

“That was inappropriate and you know it,” Williams told Schatzow before later calling Mosby’s remarks “troubling” and “mind-boggling.”

Some of the grass-roots activists who have been observing the case also have taken to Williams’s style. Lawrence Gradpre, director of research for Leaders of a Beautiful Struggle, a grass-roots think tank focused on issues affecting the city’s black residents, said Williams will often ask rhetorical questions or aggressively follow up with attorneys’ arguments to pierce the “layers of sleight of hand that lawyers tend to use when they talk about their clients.”

“He applies a strong legal mind to both sides,” Lawrence said. “What looks like being combative or confrontational is his attempt to cut through the B.S.”

Last week, Williams strongly chastised prosecutors for failing to bring forward evidence that Gray complained of prior back problems. And over the course of the trial, he’s kicked out three members of the media for violating rules about cellphone use in the courthouse. On Friday, he threatened contempt charges and sanctions, saying he was “offended” when two reporters attempted to record video of Porter during a lunch break.

“Some people seem to think they are more important than the process,” Williams said. “There is nothing more important than the process.”