NEW YORK (CBSNewYork/AP) — Authorities said an undercover New York City police officer shot and killed a man after he pulled a gun on him during a buy and bust operation with two gun traffickers on Wednesday night.

Police spokesman Paul Browne said it happened just before 8 p.m. in the Bushwick section of Brooklyn after the suspect pulled a semiautomatic pistol on his accomplice to fake a robbery and then turned the gun on the officer, who was carrying $4,000 in cash.

Brown said the officer fired three times, striking the man an unknown number of times. The victim’s accomplice picked up the gun and fled into a nearby building, but was later apprehended.

The undercover officer was not shot. The victim was pronounced dead at the scene. The weapon was recovered.

(TM and Copyright 2011 CBS Radio Inc. and its relevant subsidiaries. CBS RADIO and EYE Logo TM and Copyright 2011 CBS Broadcasting Inc. Used under license. All Rights Reserved. This material may not be published, broadcast, rewritten, or redistributed. The Associated Press contributed to this report.)