The cop and his partner, also a rookie, were descending from a dimly lit eighth-floor stairwell at the Pink Houses at 2724 Linden Blvd. about 11:15 p.m. The 28-year-old victim, Akai Gurley, entered from the seventh floor with his girlfriend, startling the cops, police sources said.

The cop fired one shot into Gurley’s chest. He stumbled down to the fifth floor, where he collapsed, sources said.

The girlfriend, Melissa Butler, 26, is distraught, her mother said.

“She keeps crying,” said Naomi Butler. “She’s very upset, she saw everything. Police shot him and we don’t know why. He doesn’t carry any firearms. He was just going back home, they were taking the stairs. He’s a nice man. He’s been together with my daughter for four years. He has one daughter as far as I know.”

An NYPD spokesman said there was no indication a weapon was recovered from the scene. A neighbor on the eighth floor, Angela Tucker, said a light in that section of the stairwell has been out for three weeks and “with that door closed, you can’t even see in the staircase.”

Gurley was rushed to Brookdale Hospital and pronounced dead on arrival, authorities said.

A rookie New York City police officer shot and killed an unarmed 28-year-old man in a darkened stairwell in Brooklyn late Thursday night, according to the police.

Police Commissioner William J. Bratton said that the victim, Akai Gurley, was “a total innocent” and called the shooting “an unfortunate accident.”

He was not engaged in any activity other than trying to walk down the stairs, Mr. Bratton said.

Mayor Bill de Blasio was also quick to offer his condolences to Mr. Gurley’s family. “This is a tragedy,” he said.

The officer who shot Mr. Gurley, Peter Liang, has been on the force for less than 18 months and was still on probationary status.

Officer Liang, 27, and his partner, who was also new to the force, were patrolling the Louis H. Pink Houses in East New York on Thursday night, part of an effort to increase the police presence at the housing complex, which had been plagued by a spate of violence, including two homicides.

The two officers had taken the elevator to check out the roof and, shortly before midnight, they entered the eighth-floor stairwell to walk back down. The lights were not working, making it nearly impossible to see, so both officers took out their flashlights.