A judge has ruled that authorities’ search of the Aurora movie theater gunman’s apartment was legal, the latest order to rebuff defense attorneys’ efforts to keep evidence against the gunman from being heard at trial.

In an order issued late Friday, Arapahoe County District Court Judge Carlos Samour wrote that police were justified in using a bomb robot to enter James Holmes’ apartment without a warrant because of the danger that explosives inside posed to the neighborhood. Holmes had told officers about the explosives shortly after his arrest, and police used the robot to open the apartment’s front door and look inside. A police officer also broke out the apartment’s windows and peeked in.

“Had investigators not taken the immediate threat of explosive devices in the defendant’s apartment seriously, they would have been derelict in their duty to protect the public and first responders,” Samour wrote in the order.

Police later obtained a warrant before searching the apartment more fully.

Samour’s order was his latest to reject defense arguments that much of the evidence authorities collected against Holmes should be kept out of the trial. Previously, Samour has ruled that searches of Holmes’ car and wallet were valid. Samour has also ruled that evidence from Holmes’ online dating profiles can be heard at trial.

The judge has yet to rule on other crucial searches — including those of Holmes’ iPhone, computers and bank records — as well as on the admissibility of statements Holmes made about the bombs in his apartment on the afternoon following the shooting.

Twelve people were killed and dozens more were wounded when Holmes began shooting inside the Century Aurora 16 movie theater in July, 2012. He has pleaded not guilty by reason of insanity. Prosecutors are seeking the death penalty.

John Ingold: 303-954-1068, jingold@denverpost.com or twitter.com/john_ingold