NYPD Officer Peter Liang was convicted of manslaughter late Thursday in the 2014 stairwell shooting death of Akai Gurley — a jury verdict Brooklyn’s district attorney said showed police were not immune from prosecution.

“We support our police officers, but when innocent men are shot and killed recklessly, someone has to be held accountable, whether that is a police officer or not, ” said District Attorney Ken Thompson, who brought charges in the fatal shooting that inflamed police critics and became part of the “Black Lives Matter” movement.

Liang, 28, buried his head in his hands after the verdict was read as his lawyers consoled him.

The rookie cop testified he took out his gun before the November 2014 shooting because he was fearful entering a dark stairwell at the Louis H. Pink public housing project. He said he fired his weapon by accident when a sound made him flinch.

After the verdict was announced, Liang remained in a cleared courtroom for about 15 minutes before being ushered out by a barricade of officers and whisked away in a waiting car.

He did not comment, but his lawyer, Robert Brown, said his client was “very upset.”

advertisement | advertise on newsday

“You had a police officer that was going onto a roof landing in a public-housing project addressing shootings in the pitch black,” Brown said. “If a police officer can’t take his gun out at that point in time, then we’re making a very difficult job even more difficult for our police officers.”

Gurley, 28, was in the stairwell with a girlfriend below Liang when a bullet ricocheted off a wall and hit him in the chest. Prosecutors argued Liang behaved recklessly by taking out his gun without a threat, and fired on purpose — not by accident — when he heard a sound.

Liang could receive no jail time or up to a maximum of 5 to 15 years in prison when he is sentenced by Justice Danny Chun on April 14. The officer was also convicted of official misconduct, a misdemeanor, for failing to give CPR to Gurley after the shooting, and faces up to a year on that charge.

Gurley’s family said afterward they were satisfied with the verdict.

“I was happy,” said the slain man’s mother, Sylvia Palmer, who embraced her husband on the front bench after the verdict was read. The family has a civil suit pending.

Get the Newsday Now newsletter!

The best of Newsday every day in your inbox.

Kim Ballinger, Gurley’s domestic partner, said, “I wasn’t surprised, I’m just glad we got a guilty verdict. . . . I do think he should go to jail.”

Jurors deliberated for three days on the case after a two-week trial that featured emotional testimony on both sides. Melissa Butler, a girlfriend of Gurley who was with him as he lay mortally wounded in the stairwell, cried as she described the bloody scene.

Liang had to leave the witness stand to compose himself.

During deliberations, the jurors asked to test and handle Liang’s gun. Each panel member squeezed the trigger in the front of the courtroom, trying to determine if the weapon could have fired by accident or required effort.

Manslaughter convictions of police for accidental shootings are rare, and Brown said he believed the decision of prosecutors in the closing argument to shift the focus of their case from Liang’s decision to unholster his gun to the claim he fired intentionally was a strong basis for a new trial.

advertisement | advertise on newsday

“It’s very clear that in the closing statement, the prosecutors changed their theory,” he said. “Clearly that could give us a very good ground for appeal.”

Supporters of Liang lamented the outcome.

“This was a terrible and tragic accident and not a crime,” said Patrolmen’s Benevolent Association president Patrick Lynch. “This bad verdict will have a chilling effect on police officers across the city because it criminalizes a tragic accident.”

City officials were subdued in their reactions.

“Regardless of the verdict in the fatal shooting of Akai Gurley, it is a somber moment for all New Yorkers, a tragedy that impacts many of our communities on a very personal level,” said Brooklyn Borough President Eric Adams.

advertisement | advertise on newsday

“The death of Akai Gurley was a tragedy,” said Mayor Bill de Blasio. “The jury has now spoken, and we respect their decision. We hope today’s outcome brings some closure to the Gurley family after this painful event.”

— With Alison Fox