NEW YORK (CBSNewYork)  — An undercover police officer is in stable condition and all three suspects are in custody following a shootout during an apparent drug operation gone bad in Bergen County Tuesday afternoon.

The shooting took place around 1 p.m. in a shopping center parking lot at 174 Passaic Street in Garfield, N.J.

READ MORE: Federal Arrest Warrant Issued For Gabby Petito's Missing Fiancé Brian Laundrie

As CBS 2’s Lou Young reported, the close-range shootout between the cops and the three alleged drug dealers broke out over a $400 marijuana buy. A 7-member backup team got involved when the gunfire erupted, Young reported.

The injured officer from the Paramus Narcotics Unit was taken to Hackensack University Medical Center, where he underwent surgery. The nine-year veteran was hit once in the right hip and once in the left ankle. His injuries are not considered life threatening.

The two undercover cops were posing as drug buyers, according to Bergen County Prosecutor John Molinelli.

“Undercover officer is wide open. No gun, no ID, nothing else,” said Molinelli. “Pointed a gun in at the Paramus police officer and said ‘give me everything that you have.’

They “started to actually physically put his hands on the undercover officer to a point where the undercover team moved in,” Molinelli said. “The minute that happens, that’s when the gunshots started.”

Various law enforcement vehicles quickly descended on the scene, WCBS 880’s Jim Smith reported.

“I saw all these cops come out of nowhere — the state troopers, the Bergen police, Lodi, so many cops,” witness Jamie Thompson told CBS 2’s Tracee Carrasco. “I’ve never seen so many cops before in my life.”

READ MORE: 'I Can't Take This Anymore': Heavy Rain In Tri-State Area Renews Flooding Concerns For Many Still Dealing With Damage From Ida

“A patient came in for an office visit and said they thought they heard shots, and then we looked out,” said Dr. John Wolozen, whose office is nearby. “All of a sudden, police all over the place.”

Police gather at Hackensack Medical Center where an officer is being treated following a shooting in a parking lot in Garfield, N.J. (credit: Lou Young/CBS 2)

Police gather at Hackensack Medical Center where an officer is being treated following a shooting in a parking lot in Garfield, N.J. (credit: Lou Young/CBS 2)

Authorities said it appears the would-be robbers mistook the officers for easy marks.

“In my judgment, this was a planned theft. They set this transaction in order to do a drug transaction but with no intention of carrying it out,” said Molinelli. “For those people that buy drugs, this is something that they face every single time. They may go to buy those drugs and then they find somebody with a gun pointed at them, they say ‘give me all your money.'”

The alleged shooter, Rafael Pena, of Passaic, was shot in the left arm and leg and was undergoing surgery in Paterson, Young reported. He and another suspect, identified as Melvin Guzman, were taken into custody at the scene and the gun was recovered, Young reported.

The alleged getaway driver, Patrick Morrell, sped off when the shots broke out but was caught by state police at the Essex County toll plaza on the Garden State Plaza a short time later, officials said.

Molinelli said Pena will be charged with attempted murder of a police officer. “We anticipate other first- and second-degree offenses against Mr. Guzman and Mr. Morrell,” Molinelli said.

The undercover officers have not been identified.

You May Also Be Interested In These Stories:
[display-posts category=”news” wrapper=”ul” posts_per_page=”4″]

MORE NEWS: 1 Killed, 13 Injured In Shooting At Kroger In Collierville, Tennessee