ALBUQUERQUE, N.M. -- The Albuquerque Police Department's handling of a deadly standoff with a homeless man who was mentally ill came under renewed scrutiny Monday as a prosecutor trying the two former officers accused in the shooting argued that police escalated the encounter and then intentionally killed him.

The events that led to the death of James Boyd started out as a call police received about someone illegally camping in the foothills bordering Albuquerque, special prosecutor Randi McGinn told jurors during her opening statement.

Eventually, 19 officers responded to the scene with firearms, hundreds of rounds of ammunition, three bean-bag shotguns, 10 cans of mace and two trained police dogs.

Boyd was armed with two pocket knives during the March 2014 standoff that ended with him shot dead, McGinn said.

"Mr. Boyd brought a knife to a gun fight," she said. "Our expert witness will say when you are up against someone with a knife, distance is your best defense."

But defense lawyers for former Officer Dominque Perez and retired Detective Keith Sandy, charged with second-degree murder, said they opened fire to protect an unarmed officer with a police dog who was very close to Boyd as the suspect pulled knives and shouted death threats.

"The government wants you to believe it's murder. It's the farthest thing from murder," said attorney Sam Bregman, who is representing Sandy. "The evidence you will hear and you will see with your own eyes is this is justifiable homicide by police officers who were doing their job."

Police video released after the shooting led to a wave of protests in Albuquerque amid growing tensions over local shootings by police, with the unrest preceding a broader national debate on use of force by law enforcement. That debate has largely focused on race but also raised questions about deadly conflicts with people suffering from mental illness.

A month after Boyd's death, the Justice Department released findings from a more than yearlong investigation into Albuquerque police that faulted them for using unreasonable force with the mentally ill and others who could not comply with officers' commands.

The officers' lawyers said in court that they were required under the training they had received to shoot Boyd. But McGinn said Boyd refused to comply with officers' orders to drop the knives and abandon his campsite because he feared the officers would shoot and kill him.

Albuquerque Police Chief Gorden Eden was the first witness called to the stand by the prosecution, and was peppered with questions Monday about his department's use of force policies at the time Boyd was shot.

A resident had complained about Boyd's campsite near a middle class neighborhood, prompting the March 16, 2016 police show of force. Boyd, who was diagnosed with schizophrenia and had been previously involuntarily committed for at the state psychiatric hospital, held officers at bay after pulling two pocket knives, the police video shows.

As more officers converged on the scene, Boyd in his conversations with them clung to a made-up persona that he was a U.S. Defense Department official. Sometimes he shouted, and sometimes he talked about a special national security mission as officers appeared to play along in their attempt to take him into custody.

Perez and Sandy arrived separately after being briefed that Boyd's prior arrest record included an alleged assault on a police officer. They also knew other officers had repeatedly called on Boyd to drop his knives and abandon his make-shift campsite marked by a spread of tarps covering his belongings.

Video from Perez's helmet camera shows Boyd talking about being willing to walk down the rocky hillside with officers when police detonated a flash grenade.

The explosion was meant to disorient Boyd. Instead, he reached for his knives as a police dog and the dog's handler advanced toward Boyd. He was shot seconds later in the arms and back and died at a hospital early the next morning.

Jurors must decide whether Perez and Sandy justifiably perceived that Boyd posed a life-threatening danger to officers.

In 1989, a Supreme Court decision concluded that an officer's use of force must be evaluated through the "perspective of a reasonable officer on scene rather than with the 20/20 vision of hindsight." The ruling was mentioned in court repeatedly on Monday.

Luis Robles, Perez's attorney, said his client made a "life-or-death decision" in a tumultuous and fast-moving situation when he saw the other officers several feet away from Boyd.

"This is not a crime," Robles said. "This is instead a reasonable decision made by an officer."

-----

Associated Press writers Russell Contreras and Susan Montoya Bryan contributed to this report.