A Prince George’s County judge ruled that racist content found on the phone of a man arrested in the killing of a black student at the University of Maryland should be allowed as evidence at his murder trial linked with a hate-crime charge.

It should be up to a jury to decide whether the material on devices for Sean Urbanski — some of which depict violence against black people — played a role in the May 2017 fatal stabbing of Richard Collins III, the judge said Wednesday.

Attorneys for Urbanski, 24, who is white, asked the judge to ban offensive content found on their client’s phone and social media accounts as evidence in his trial scheduled for July. They argued the “particularly offensive” evidence is not relevant or connected in time to the killing of Collins, 23.

The materials were not shared openly in court but Urbanski’s attorneys in previous court filings asked the judge to exclude a now-deleted Facebook page called “Alt-Reich: Nation,” and cartoon images and group messages found on his devices. On Wednesday, the defense also disclosed that Urbanski’s blood alcohol level was nearly three times the legal limit in Maryland during the stabbing. Urbanski’s lawyers at earlier hearings have suggested that alcohol may have played a role in the incident.

Prosecutors argued the images should be shown to a jury to explain why Urbanski allegedly bypassed a white man and an Asian woman at the scene of the incident to directly stab a black man, Collins.

The photos speak to “why the only black person at that bus stop was stabbed,” said Jason B. Abbott, Prince George’s County’s principal deputy state’s attorney.

The material on Urbanski’s devices — at least seven images — date from Christmas Day 2016 to April 18, 2017. Two images appear on Urbanski’s phone from about one month before Collins’s killing, and the phone showed that almost once a month a fresh image of the same racially insensitive nature appeared on Urbanski’s phone, Prince George’s Circuit Court Judge Lawrence V. Hill Jr. noted.

“It almost leads like a chain of events up until May,” Hill said.

Urbanski, a Severna Park resident and former U-Md. student, has pleaded not guilty in the May 20, 2017, incident.

Collins was attacked while waiting for a ride with two friends he was visiting at the University of Maryland in College Park, police said. Urbanski approached the group at a bus stop that night and told Collins to “step left, step left if you know what’s best for you,” before stabbing him with a folding knife, police charging documents state.

Collins was killed shortly after he had been commissioned as a second lieutenant in the Army and right before he was to graduate from Bowie State University.

At least two of the images Urbanski’s attorneys sought to block “suggest some level of violence,” said Hill, who on Wednesday described the images he was shown on a television screen that the public in the courtroom could not view. One image showed a noose and a gun but did not suggest violence toward a particular group. Others included references to black DNA or were racist jokes, the judge said.

Urbanski’s lawyers acknowledged that someone using their client’s account liked an “Alt-Reich­” page on Facebook. But they also noted that the page’s creators had said in a newspaper interview that the page was created as satire and that the creators weren’t white supremacists.

Urbanski’s attorneys said during the hearing there is no evidence showing whether their client deliberately sought out or interacted with the images on his phone or whether they had been sent to him unsolicited. Including them at trial would violate his First Amendment free speech rights, defense attorneys William C. Brennan and John McKenna said.

“Possessing racially insensitive material is not against the law,” Brennan said.

Brennan said his client was also “out-of-his-mind drunk,” with an alcohol concentration that eight hours after the killing showed as 0.10.

Much of Wednesday’s arguments centered on a 1994 Maryland appeals case in which a man was charged in the kidnapping and attack of two black women in Montgomery County. In the case, prosecutors introduced trial evidence about the defendant’s racist encounter with a group of black teens three days before the assault of the two women. Upset about the interaction with the teens, the defendant was heard saying shortly after he was going to go “hunting” for a black person — using a racist slur — before he went on to attack the two women.

An appeals court later decided evidence from the prior encounter was allowed because there was a “tight nexus” between the attack of the two women and the preceding racist interaction with the teens.

Urbanski’s attorneys said that in the 1994 case, the prior speech was clearly connected to the offense. But in Urbanski’s case, Brennan and McKenna argued, there is no evidence directly linking the memes on their client’s phone to Collins’s killing.

Assistant State’s Attorney Jonathon R. Church said the images show intent and a mental state that would speak to a motive for murder. The images, Church said, were interspersed on Urbanski’s phone among images of family, his girlfriend and his university life.

Church said a video of the incident captured by security cameras — which the judge also viewed Wednesday — shows Urbanski standing in the shadows before approaching Collins and his group. Urbanski is then seen clearly passing by the other man and a woman at the bus stop with Collins before stabbing him, Church said.

Afterward, Church said in court, Urbanski “folded the knife, put it back in his pocket and sat at the bus stop where police found him.”