Mr. Kelly identified the officer who fired the shots only as a four-year veteran of the department, and said he had fired six rounds from his 9-millimeter Glock. Two bullets struck Officer Edwards.

Image Dozens of officers gathered outside the Harlem Hospital Center emergency room early Friday morning. Credit... Patrick Andrade for The New York Times

Officer Edwards, a recently married father of two from Brooklyn, was taken to Harlem Hospital Center, where he was pronounced dead at 11:21 p.m. No one else was injured.

"While we don’t know all of the details of what happened tonight, this is a tragedy,” Mayor Michael R. Bloomberg said during an early morning news conference at the hospital. “Rest assured we will find out exactly what happened here and see what we can learn from it so it can never happen again.”

The shooting is likely to raise questions again about departmental procedures involving communications among plainclothes officers  particularly those in different units  as well as issues of race. Officer Edwards was black; the officer who shot him was white.

Mr. Kelly said the tragic string of events began when Officer Edwards, a member of the Housing Bureau Impact Response Team, left duty about 10:30 p.m., approached his car and saw that a man had broken the driver’s side window and was rummaging through the vehicle. The two scuffled, and the man escaped Officer Edwards’s grip by slipping out of his sweater.