The hero NYPD cop killed in a struggle with an armed suspect received a final salute Sunday as an ambulance carried his body, police said.

Brian Mulkeen, 33, died at Jacobi Hospital following the shootout just after midnight Sunday on the grounds of Edenwald Houses in The Bronx.

Outside the hospital, dozens of uniformed officers were seen in a video standing at attention to salute the ambulance carrying Mulkeen’s body to the Manhattan Medical Examiner’s Office.

Mulkeen, a six-year veteran serving the anti-crime unit in 47th Precinct, had been struck by gunfire as he wrestled on the ground with the suspect, police said.

“Officer Mulkeen’s gun fired five times,” Chief of Department Terence Monahan said. “At this point, it is not clear who fired Officer Mulkeen’s gun.”

The suspect was also fatally shot in the encounter, he said. Police were awaiting ballistics testing to determine who shot the officer.

“Five officers at the location fired their service weapons, striking the man,” Monahan said.