An undercover drug bust that ended in a shootout Tuesday at a Garfield shopping center did more than just alarm residents, send a Paramus cop to the emergency room and touch off a chase across North Jersey — it also exposed the extensive, dangerous and often invisible world of undercover narcotics investigations conducted regularly across the region.

“People see the officer in uniform, in the marked police cars, and that’s the image of law enforcement,” said Mahwah Police Chief James Batelli, who also heads the Bergen County Police Chiefs Association. “Behind the scenes, they may not realize that [undercover work] goes on a lot more in Bergen County than most people realize. They may not realize the amount of law enforcement that is undercover.”

While there are no official numbers on how many undercover municipal, state and county detectives are operating in Bergen County at any given time — building cases, making drug buys, conducting long-term intelligence gathering — municipal police departments often work covert operations alongside the county Prosecutor’s Office, the Drug Enforcement Administration and the FBI.

This often entails sending local beat cops undercover, out of uniform and unarmed. The county pays municipal police departments for their time.

Operations such as the one that took place in Garfield typically involve hand-to-hand sales on the streets, in cars or in public places. Typically, the most dangerous encounter for an undercover officer is meeting a source — such as a dealer — for the first time, officials said.

“There’s always a risk,” said a state law enforcement official who has worked extensively |with undercover detectives. “Bad guys rob bad guys all the time. You get a lot more close calls than you might think.”

The undercover officer making the drug buy is observed by an advance team, often in vehicles, waiting at locations plotted out ahead of time.

The Garfield buy was part of a small-scale operation involving a handful of detectives from the Prosecutor’s Office, the Paramus Police Department and the Bergen County Sheriff’s Office, Molinelli said Tuesday.

The Prosecutor’s Office is also working with several neighboring counties and numerous municipal police departments on a separate, initiative focused on the heroin trade in Paterson.

Using undercover officers for drug purchases is “a very common occurrence,” the state law enforcement official said.

Part of this is a matter of expediency: “It’s a lot easier to prosecute a job when you have an undercover [officer] involved, you don’t have to worry about the credibility of an informant,” the state official said.

“You’ve got to portray yourself as a criminal without actually partaking in criminal activity,” Batelli said. The work is “specialized and not talked about because of the perils that come with being undercover.”

Some have expressed concern about the scale of counter-narcotics operations in the state, and the use of law enforcement resources to investigate and prosecute even small-scale drug offenses.

“The amount of money dedicated to the narcotics trade is mind-boggling, as opposed to patrolling the streets, policing violent crime,” Dale Jones of the state Public Defender’s Office said recently.

These buys may happen out in the open, but the rationale behind undercover initiatives are often kept secret, which disturbs Rich Rivera, a former police officer and civil rights advocate with the Latino Leadership Alliance of New Jersey.

“I doubt that $400 worth of marijuana is worth any police ­officer’s life,” Rivera said. “Some of our main concerns are the ­pursuit of the Bergen County Prosecutor’s Office of low-level offenses while risking police ­officers’ safety and seizing |assets.”

But Batelli said there’s good reason to keep the pressure on with undercover marijuana buys and small-scale drug stings in general.

Batelli said the Bergen County chiefs had met to discuss the question a few days before the undercover operation that went bad in Garfield.

“We found it disturbing that some prosecuting attorneys are pressing for decriminalization of marijuana,” Batelli said. “We’ve seen enough accidents resulting in fatalities or critical injuries where marijuana played a role to know that it’s just as dangerous as drinking while driving,” he said.

“It depresses the central nervous system, it results in brain impairment, and it often comes laced with dangerous additives,” Batelli added. “And the fact is, it’s still illegal in New Jersey and as long as it is illegal, it will be a focus of enforcement.”

Passaic County Sheriff Richard H. Berdnik also defended the use of undercover operations in marijuana busts and small-scale drug law enforcement, as well as the use of motor vehicles seized in drug operations for future undercover work.

“It’s an important part of law enforcement,” Berdnik said. “As professionals, we are obligated to enforce the laws until they are changed.”

The sheriff said it was “very rare that someone deals only in one particular drug. They’ll sell whatever the customer wants. It might be marijuana today, cocaine tomorrow and heroin the next day.”

Moreover, he said, it is a good use of resources to go after small-scale drug dealers. “Little fish lead to bigger fish,” Berdnik said. “You start with the guy selling on the street and you work back to the distributor and on up the chain.”