A Hammonton man pleaded guilty to multiple cases Monday, including gun possession and brandishing a knife on two separate occasions.
Victor Martinez, 54, faces a sentence of 10 years with five years of parole ineligibility under the plea agreement.
He then was released pending sentencing in March, despite the state's objection.
Martinez was arrested Feb. 29, after he was stopped on London Avenue in Egg Harbor City as part of a drug investigation by the Atlantic County Prosecutor's Office and Egg Harbor City police.
A warranted search led to a backpack containing a Glock 9mm handgun with two extended magazines and small quantities of crack cocaine and fentanyl.
A prior robbery conviction made Martinez unable to legally possess a weapon.
Martinez also admitted Monday that he had been involved in two prior separate incidents in Egg Harbor City during which he brandished a pocketknife during a verbal argument, and obstructed police officers who were conducting a drug-related investigation.