The officer, though shot, was able to shoot some of the suspects and make an arrest before radioing for help.
Authorities say 36-year-old Nelson Vergara had just finished his shift and was returning home to his home in University Heights when a group of men started heckling him.
NYPD Commissioner Ray Kelly says one even threw a bottle at Vergara, who quickly identified himself as a police officer.
"As he approached the group, a green Honda pulled up to the scene," Kelly said. "A male in his 20s exited the vehicle and began firing several times at a man in that group."
Caught in the middle of the crossfire, Vergara was shot in the shoulder and leg. Amazingly, he was still able to squeeze off 11 shots, hitting the gunman, who was able to escape.
Despite being hurt, Vergada handcuffed the bottle thrower, who was also shot, and called for backup.
Friends drove the injured gunman to Bronx Lebanon Hospital, where he was treated and arrested.
Vergara is a 12-year veteran of the department, and a Marine who has served two tours in Iraq. He and his wife have two children.
He and the suspects are all listed in stable condition.
WAKE UP WITH EYEWITNESS NEWS! Click here to download the WABC Eyewitness News Alarm Clock app from iTunes. or search WABC or 7online in the app store.
Get Eyewitness News Delivered