By Russell Contreras

Associated Press

ALBUQUERQUE, N.M. — A former and a current New Mexico police officer charged with murder sat motionless after a judge announced they would have to face a jury trial for the on-duty shooting of a homeless man.

Officer Dominique Perez and former Detective Keith Sandy were ordered Tuesday to stand trial for the 2014 killing of 38-year-old James Boyd, whose shooting in the foothills of the Sandia Mountains was caught on video and sparked national outrage.

It's unusual for a judge to order police officers to stand trial for murder — even as the country debates use of force by police and sees protests in far-flung places over shootings by officers.

Only seven police officers around the country have faced murder charges for on-duty incidents since 2010. One was convicted of manslaughter and assault after a second-degree murder count was dropped. The rest are still in court proceedings.

In New Mexico, Pro Tem Judge Neil Candelaria ruled after a nearly two-week preliminary hearing that there was probable cause for Perez and Sandy to face trial.

Unlike secret grand jury proceedings after police shootings in New York and Ferguson, Missouri, the hearing in Albuquerque was open to the public and streamed online by television media outlets.

Candelaria's decision was met with silence in his packed courtroom. Some supporters of Perez and Sandy held their hands over their mouths in disbelief.

There have been more than 40 shootings by Albuquerque police since 2010 and only Perez and Sandy have been ordered to stand trial.

After the ruling, defense lawyer Sam Bregman asked Candelaria what standard he used to justify probable cause. Candelaria replied, "What a reasonable police officer in that situation would do."

Defense lawyers did not immediately comment after the ruling. But in a radio interview, Bregman said the decision meant Albuquerque police have the toughest job in the country.

Special Prosecutor Randi McGinn said during the hearing that Perez and Sandy came to the scene with the intent of attacking Boyd during a "paramilitary response" and created the danger.

"He was shot in the back and in the side," McGinn said during her closing argument. "That shows that he was not a threat when they shot him."

McGinn pointed out that Sandy in a recording vowed that he was going shoot the "lunatic" before going into the foothills. Other officers testified that police at the scene knew Boyd was mentally ill, but it was unclear if Sandy and Perez knew he was schizophrenic.

Video of the 2014 shooting taken with an officer's helmet camera showed Boyd gathering his belongs and appearing to surrender after an hours-long standoff.

Police then detonated a flash bomb near Boyd, who dropped his bag and pulled two knives before Perez and Sandy shot him as he fell to the ground.

Authorities had been called to the scene over a report of an illegal camper. Boyd died at a hospital after his arm was amputated.

Defense lawyers said Boyd had threatened officers with two knives and Perez and Sandy had no choice about opening fire. The lawyers said the officers were following their training and protecting their colleagues.

The killing of Boyd generated angry protests in Albuquerque before the nation watched similar scenes unfold in Ferguson after a white police officer killed an unarmed 18-year-old black man.

Shortly after the killing of Boyd, Justice Department officials released a harsh report faulting Albuquerque police for excessive force, especially against suspects suffering for mental illness.

The city and the Justice Department later reached an agreement to overhaul policies involving use of force and to appoint a federal monitor to oversee reforms.

In a statement, Albuquerque Police Chief Gorden Eden said he couldn't comment on the judge's decision since he expected to be a witness at the trial.

"As this case is moving though our judicial system, my focus is on continually moving the Albuquerque Police Department forward," Eden said. "We will protect our community, and I greatly appreciate the hard work and sacrifice of those who wear a uniform each and every day."

No arraignment date has been set and the officers are not in custody.

Copyright 2015 The Associated Press