A New York City police officer was convicted of manslaughter on Thursday for killing an unarmed man who was hit by a ricocheting bullet fired from the officer’s gun in the stairwell of a Brooklyn housing project in a case that highlighted concerns over police accountability.

The officer, Peter Liang, and his partner were conducting a so-called vertical patrol on Nov. 20, 2014, inside the Louis H. Pink Houses in the East New York neighborhood. At one point, Officer Liang opened a door into an unlighted stairwell and his gun went off. The bullet glanced off a wall and hit Akai Gurley, 28, who was walking down the stairs with his girlfriend, and pierced his heart.

Mr. Liang, a rookie officer who had graduated from the Police Academy the year before the shooting, was also found guilty of official misconduct for failing to help Mr. Gurley as he lay on a fifth-floor landing. Mr. Gurley’s girlfriend, Melissa Butler, had testified that while she knelt in a pool of his blood trying to resuscitate him, the officer stopped briefly but did not help before proceeding down the stairs.

The verdict, delivered in State Supreme Court in Brooklyn, comes amid a national debate on the policing of black neighborhoods after a string of killings of unarmed black men by police officers. And the jury’s decision is a rare instance in which a police officer was convicted of killing someone in the line of duty.