According to Bergen County Prosecutor John L. Molinelli, it all began when the undercover detective, a nine-year veteran of the Paramus Police Department assigned to the Bergen County Prosecutor’s Office Narcotics Task Force, was sitting in the driver’s side of an undercover vehicle at about 1:30 p.m., purportedly to buy marijuana from Melvin Guzman, a 19-year-old from Garfield.

Pena showing up wasn’t just dumb luck, Molinelli said. There was never going to be a drug deal.

“In my judgement this was a planned theft,” he said.

In that case, it didn’t go as planned. The undercover detective grabbed the gun, and a fight broke out. (Molinelli would not identify the detective, telling reporters that doing so would compromise the officer's safety and investigations he's assigned to.)

During the scuffle, the detective was shot twice: in the right hip and the left leg.

But the detective wasn’t alone. A backup team of seven undercover narcotics officers were in a vehicle nearby –– five from the Bergen County Prosecutor’s Office, and two from the Bergen County Sheriff’s Office.

When the fight broke out, two of the Prosecutor’s Office detectives opened fire, hitting Pena multiple times. Most were grazes, but Pena suffered two direct hits to his right arm and left leg, Molinelli said.

During the action, a third man, Patrick E. Morell, 21, of Clifton, who allegedly drove Guzman to the scene, sped backward out of the parking lot and led police on a chase, Molinelli said. New Jersey State Police arrested him near the Essex Toll Plaza of the Garden State Parkway, and are holding him at their Bloomfield barracks.

Pena will likely be charged with attempted murder, Molinelli said, and Morell and Guzman will likely be charged with 1st and 2nd degree offenses.

The undercover detective was expected to come out of a Hackensack University Medical Center operating room Tuesday evening, Dr. Joseph Feldman, chair of emergency services at the hospital, said.

“We assume from his injuries he will have a full recovery,” Feldman said.

Pena was also in surgery Tuesday evening at St. Joseph’s Hospital in Paterson, Molinelli said. He wasn’t clear on Pena’s status, but his injuries aren’t life threatening.

It was supposed to be a simple marijuana deal.

“Narcotics, even in this county, is a dangerous practice,” Molinelli said. “These officers were prepared.”

The Attorney General's Office, per state guidelines, will investigate the use of force.