An off-duty NYPD cop -- who did two tours as a Marine in Iraq and was a first-responder on 9/11-- was wounded in a shootout in the Bronx early Sunday morning.

Officer Nelson Vergara, 36, was returning home from work at Phelan Place near West Tremont Avenue in University Heights, when a group of men began to heckle him. One man even threw a beer bottle at Vergara, which landed on the ground near the cop's feet. Vergara started to approach the group, when, from The New York Post:

Suddenly, a green Honda rolled up and a gunman, identified as José Baez, 21, ran out and shot Adonis Almonte, 17 — the teen who allegedly had thrown the bottle.

As Almonte lay on the ground bleeding, Baez stood over him and prepared to fire another shot, a law- enforcement source said.

That’s when Vergara reached the sidewalk and identified himself as a cop.

“There was obviously some sort of issue between the shooter and at least one person in that group,” Police Commissioner Ray Kelly said at a press conference. “Vergara was caught in the middle.”

Vergara, who was shot in the leg and shoulder, fired 11 shots, managing to hit the gunman, who fled the scene.

And although he was injured, Vergara also managed to arrest the alleged bottle-thrower Almonte, who'd been shot in the neck, arm and back.

Baez and two friends were arrested when they brought him into Bronx Lebanon Hospital to treat his wounds.

Both Vergara and Amonte were taken to St. Barnabas Hospital and are in stable condition.

Almonte's mother was grateful for Vergara. “Thank God for the cop who saved my son’s life,” Jobbny Almonte, told The Daily News.

Kelly and Mayor Michael Bloomberg visited Vergara in the hospital Sunday.

“Shootings like this, sadly, no longer seem to matter to the national campaigns,” Bloomberg said. “But what we will do to get guns out of the hands of criminals, where they’re used against our parents and our children, and in this case a police officer and Marine, is far more important than most of the gaffe-gates and other ridiculousness that define our political dialogue.”

Vergara's brother, John Lopez, also a NYPD cop, was shot 6 years ago while foiling a bank robbery in Queens. Lopez managed to shoot the robber in the leg and stomach.

Lopez's wife, Peggy, speaking of the brothers' bravery, said, "It must run in the family."