An undercover drug buy ended in gunfire in a shopping center parking lot on Tuesday, leaving a police officer wounded and two suspects in custody and another hospitalized.

The undercover officer was posing as a prospective drug customer and was in the driver's seat of a car with a suspected drug dealer in the passenger seat, Bergen County prosecutor John Molinelli said. The car was sitting about 100 yards across the parking lot from a Marshall's department store when a second man approached the car and demanded that the officer "give him everything," he said.

The man pointed a gun at the officer, became agitated and shot him twice during a scuffle, Molinelli said.

The officer was struck once in his left side and once in an ankle. He was hospitalized in stable condition.

Narcotics task force members monitoring the staged transaction, for about $400 worth of marijuana, fired several times at the suspected shooter, who was hospitalized with injuries police said were not considered life-threatening. Police said they believe he and the suspected dealer were working together. They were arrested at the scene, where police recovered the suspected shooter's weapon plus drugs and money, Molinelli said.

A third man, who police said had driven the other two to the scene, fled in a car when the shooting began, Molinelli said. State police arrested him a short time later near a toll plaza on the Garden State Parkway.

Police were withholding the officer's name due to his undercover status but said he's a nine-year veteran of the Paramus Police Department and was on loan to a Bergen County narcotics task force.

Molinelli called the incident an "an average street drug buy" and praised the work of the task force officers.

"This is what they do, every day, every night, 365 days a year," he said.

Molinelli said he believes the injured officer had been set up for robbery by the three men. He said the officer was not armed or wearing a bulletproof vest since he was participating in an undercover operation.

"He was wide open," Molinelli said.

Witnesses reported hearing several shots and said at least one person was bleeding from his head and leg.

"We heard three or four popping noises and saw one (wounded) guy on the ground," said Brianna Colon, who was walking with a friend along a nearby sidewalk when the shots were fired.

Stefano Cutillo and his friend Andre Sajnoski said they were eating in a fast-food restaurant across the parking lot from where the shooting occurred.

"My mom was in Marshall's at the time, and she called to say, 'Don't come out,'" Cutillo said.