The accident unfolded in a matter of seconds, with the elevator jolting back upward so quickly that Mr. Modan got caught partially outside the open door.

His body had to be extracted by firefighters. He was still breathing when his friends reached the lobby through an elevator hatch, but he had serious trauma to his head and torso, the police said.

One complaint about the elevator, filed in November 2012, said the elevator “will only go up and only opens halfway.”

“It also wobbles and jerks up and down,” the complaint continued. “Unsafe to get in.”

Another, filed in December of that year, said the elevator was “not working again,” as happens “every 3 or 4 weeks.” The third, also filed in December, said the “elevator door opens halfway and shakes up and down sometimes when stopping on floor.” Buildings Department records indicate an inspection was performed and no violations were found.

Pez Epstein, 44, who has lived there for three years, said his girlfriend got trapped in the elevator earlier this year when the doors would not open. “She started pushing the bell, and after about five minutes the door just opened,” Mr. Epstein said.

Another tenant, Leo, said the elevator had to be closed down and repaired only two weeks ago, so he had to use the stairs. A man who has lived there for a year and a half said he had gotten stuck “a few times.” Both declined to give their full names because they did not want to draw attention to themselves.

“I’ve just gotten into the elevator and it doesn’t go anywhere, and the door won’t open back up,” the man said.