Two Albuquerque police officers were charged with murder in the March killing of a homeless camper, a shooting that generated sometimes violent protests around the city and sparked a federal investigation into a police force that has been found to use excessive force.

Swat member Dominique Perez and former Detective Keith Sandy will each face a single count of open murder in the death of 38-year-old James Boyd, Second District Attorney Kari Brandenburg said Monday. Open murder allows prosecutors to pursue either first-degree or second-degree murder charges.

Police said Perez and Sandy fatally shot Boyd, who was holding two knives, during an hourslong standoff in the foothills of the Sandia Mountains. Video from an officer’s helmet camera showed Boyd, who authorities say had struggled with mental illness, appearing to surrender when officers opened fire.

The case is a departure after grand juries declined to charge officers in the shooting death of unarmed 18-year-old in Ferguson, Missouri, and the chokehold killing of another unarmed man in New York City.

Sam Bregman, lawyer for Sandy, told The Associated Press that the charge was “unjustified” and said Sandy did nothing wrong.

“Keith, as a police officer, had not only the right, but the duty to defend a fellow officer from a mentally unstable, violent man wielding two knives,” Bregman said.

Luis Robles, an attorney for Perez, said, “Sadly, this day has come. Regardless, I am confident that the facts will vindicate Officer Perez’s actions in this case.”

The FBI is investigating the Boyd shooting, but U.S. authorities have not said if the officers will face federal charges.

Albuquerque officials recently signed an agreement with the US Justice Department to revamp its police agency after a harsh report over excessive force. Under the agreement, Albuquerque police must provide better training for officers and dismantle troubled units.

The Boyd shooting — and more than 40 other police shootings since 2010 — sparked a series of protests, including one that forced authorities to fire tear gas at violent demonstrators and another that shut down a City Council meeting.

The criminal charges were the first Brandenburg has brought against officers in a shooting, something for which she has come under scrutiny. She filed the counts via criminal information, which allows her to charge the officers without presenting evidence to a grand jury.

She has been criticized for her office’s controversial, decades-old practice of using grand juries to affirm prosecutors’ decisions that no probable cause existed to charge officers in shootings. Most district attorneys in New Mexico and around the country resolve police shooting cases with an internal investigation.

Under a revamped system, county prosecutors decide whether there’s probable cause that a crime was committed.

Brandenburg said in a statement that the date for a preliminary hearing for the two has not yet been set.