ANNAPOLIS, Md. — Surveillance video inside a Maryland newspaper office that shows a wounded employee crawling away and others hiding or running for their lives during a gunman’s rampage can be used at the suspect’s trial, a judge ruled Wednesday.

Prosecutors have described the video as “the silent witness“ in the case against Jarrod Ramos, who is charged with killing five people at the Capital Gazette.

Judge Laura Ripken said she considered redacting parts of the video but then decided not to because it could cause confusion and potentially mislead jurors.

Ripken said the video backed all 23 counts against Ramos, and as such would be the “best evidence” against him in next month’s trial.

Defense attorneys for Ramos had asked the judge to block most of the video from being shown.

Elizabeth Palan argued that parts of the video were so graphic, they were “unfairly prejudicial.“ She contended still photographs of the scene could be used instead.

But Anne Colt Leitess, the state’s attorney, said the defense was trying to “sanitize” the evidence of a horrific crime. While admitting the video is “very tough to watch,“ Leitess said photographs simply could not convey the terror experienced by victims.

“It just would not do this case justice, your honor,” Leitess said. “It would be grossly unfair.“

The video shows Ramos wearing earplugs and shooting glasses and checking to make sure the laser sight on his gun is on before he tries to open a locked door and shoots his way inside on June 28, 2018, prosecutors said.

It also shows sales assistant Rebecca Smith, who later died at a hospital, trying to crawl away after being shot, as two other employees run out of the office. The video does not show anyone being shot.

John McNamara, Wendi Winters, Gerald Fischman and Rob Hiassen also died in the attack.

Ramos has pleaded not guilty and not criminally responsible, Maryland’s version of an insanity defense.

Another video recording shows the back of the office, where police say Ramos had barricaded the door to prevent people from escaping.

The video shows employees attempting to flee and unable to open the door.

Police say they arrested Ramos after the shooting as he hid under a desk in the newsroom.

Ramos, 39, had a long history of harassing the Capital Gazette’s staff in connection with a defamation suit he filed against the newspaper in 2012, authorities have said. The suit was thrown out.

Three days of jury selection are scheduled to begin Oct. 30. The trial is set to start Nov. 4.