Peter Liang, second from left, sits with his legal team on Feb. 11 in a Brooklyn courtroom. (Mary Altaffer/Pool via AP)

A New York judge ruled Tuesday afternoon that Peter Liang, the rookie NYPD officer who shot and killed Akai Gurley in the stairwell of a Brooklyn housing project, will not serve jail time.

Although Liang was convicted of manslaughter in February, state Supreme Court Justice Danny Chun said at a hearing Tuesday that he was reducing that conviction to criminally negligent homicide and sentencing the former officer to five years probation and 800 hours of community service.

“Given the defendant’s background and how remorseful he is, it would not be necessary to incarcerate the defendant to have a just sentence in this case,” Chun said during the hearing, according to the Associated Press.

Gurley was killed in November 2014 as he and his girlfriend opened a door to the stairwell to exit. Liang was patrolling the building with his gun drawn and fired a shot that ricocheted off a wall and struck Gurley in the chest. The former officer testified during the trial that he inadvertently fired his gun after being startled by a noise. Prosecutors contended, however, that Liang had fired his gun recklessly and did not provide appropriate medical aid to Gurley.

The shooting occurred at a time when New York was at the fore of the nation’s conversation about police violence, just days before a grand jury would decline to indict any officers in the death of Eric Garner, another unarmed black man. And the prosecution of Liang, a Chinese American, polarized Asian American communities in New York, some of which argued that he would not have faced legal consequences if he were a white officer.

The case was a rarity: one of the few times that a police officer faced charges for an on-duty shooting. Even rarer still was that Liang was convicted.

A Washington Post analysis in 2015 found just 65 cases during the previous decade in which an officer had been prosecuted for an on-duty shooting. Of those, only 11 of the cases resulted in a conviction.

Liang faced up to 15 years in prison, but in a move that angered Gurley’s family as well as many activist groups who were monitoring the case, Brooklyn District Attorney Ken Thompson recommended that Liang be spared jail time.

“Growing up, my parents thought it was a foolish dream that I wanted to become a police officer. When I graduated from the academy it was a dream come true,” Liang told the judge, according to the New York Daily News. “Judge, my life is forever changed, I hope I have a chance to improve.”

Related:

Police fatally shot nearly 1,000 people last year

Thousands dead, few prosecuted

Current and former officers describe tension amid new focus on shootings

Federal grand jury begins hearing evidence in Garner case