The Brooklyn district attorney declined to comment on the indictment before it was unsealed. Officer Liang’s lawyer, Stephen C. Worth, said he would address the charges after his client was arraigned on Wednesday.

Image Akai Gurley

From the start, the circumstances of Mr. Gurley’s death diverged sharply from the kind of standoffs that preceded the deaths of Mr. Garner and Mr. Brown, an unarmed black teenager fatally shot by an officer in Ferguson, whose death in August set off the initial wave of protests against aggressive police tactics last year.

There was no encounter or words exchanged between Officer Liang and Mr. Gurley before the fatal shot, the police said.

Officer Liang and his partner, Officer Shaun Landau, entered an eighth-floor stairwell in the Pink Houses at about 11:15 p.m. on Nov. 20. Officer Liang had his 9-millimeter gun drawn, according to the police, not uncommon for officers walking the interiors and rooftops of public housing complexes in so-called vertical patrols. His partner kept his gun holstered.

At the same time, Mr. Gurley and his girlfriend, Melissa Butler, entered the seventh-floor stairwell, 14 steps below.

According to the police account, almost as soon as Officer Liang opened the door, his gun went off. He immediately moved back onto the rooftop, the door closing in front of him and his partner. Officer Liang then uttered words to the effect that he had accidentally fired, the police said at the time, citing the partner’s account.

Ms. Butler ran from the sound, but she turned when she noticed Mr. Gurley was no longer following. She found him near a fifth-floor landing. Then she rushed to the apartment of a friend, who dialed 911.