A St. Paul man with a mental illness whose armed standoff with police in 2015 left an officer with an air rifle pellet lodged in his face was sentenced Monday to eight years in prison.

Robert Wood’s sentencing day landed amid national turmoil over slayings of law enforcement officers that followed weeks of protests over the deaths of blacks in encounters with police.

Wood’s story was highlighted in a recent Star Tribune series “A Cry for Help” showing that more than 45 percent of the people who die in police encounters in Minnesota had a history of mental illness or were in the throes of a mental health crisis.

In Wood’s case, St. Paul police held their fire, even after officer Mike Talley was struck in the face by a pellet from Wood’s air rifle.

Judge Joy Bartscher said that despite Wood’s chronic mental illness, he needed to be held accountable. The sentence was less than the 120 months she could have imposed, and she fined him just $50.

“Your actions put everybody at risk,” Bartscher told Wood.

Wood, a 55-year-old former sound engineer, has been in jail since Jan. 2, 2015, when his suicide attempt spiraled into an hourslong standoff at his home in St. Paul’s North End neighborhood. Wood pleaded guilty to first-degree assault last February.

Wood’s lawyer Chris Zipko argued that Wood needed treatment, not jail time for his chronic problems with depression, anxiety and a bipolar disorder. He said Wood was trying to goad police into killing him that day, and the pellet that struck Talley had ricocheted off a vehicle.

Prosecutors argued that Wood intentionally sought to harm officers. If Wood had wanted officers to end his life, he would have gone out onto the front porch and aimed his .25-caliber pellet rifle, and not let off shots from the safety of a second-floor window, said Assistant Ramsey County Attorney Hao Nguyen.

He said Wood repeatedly gave up on mental health treatment over his adult life and should be treated while behind bars so he can’t walk away again.

With several uniformed St. Paul officers on hand to show support, Talley told the court how the divot in his right cheek reminds him of the shooting every day. He said he did not have his weapon drawn when Wood started firing.

“I heard Mr. Wood say he saw me and he was going to shoot me in the head,” Talley said.

Talley said doctors told him the pellet narrowly missed a major blood vessel and that he was lucky to be alive. A large picture of his blood-smeared face projected on a screen showed a hole in his cheek about the size of a pencil eraser.

“I did not deserve to be shot in the face for doing my job,” Talley said.

Wood apologized to Talley and broke down in tears.

“If I thought for a moment that gun would kill somebody, I would have turned it on myself,” he told the judge.

In Minnesota, people serve two-thirds of their sentences incarcerated and the rest on parole. Given his time served, Wood will likely spend three years and 10 months in jail with the remainder on parole.

Family and friends of Wood expressed disbelief outside the courtroom.

“I’m surprised that they are continually using the prison system has a dumping ground for the mentally ill,” said Wood’s brother Wiliam, of St. Paul.

Talley declined to be interview.

Zipko said he was “disheartened” by the sentence but not surprised.

“I truly think the police have a daunting, thankless job and they don’t get the attention or praise that they need,” he said. “Given the environment we’re in, it’s a difficult decision.”