Thirteen months after his arrest, Mr. Cramsey pleaded guilty to one count of unlawful possession of a weapon and one count of possession of a weapon for an unlawful purpose.
Under the plea deal, both second-degree charges carry a five-year sentence with one year of parole ineligibility.
Mr. Cramsey could face just nine months in prison, having already served about three months in the Hudson County Correctional Facility after his arrest, said James Lisa, his lawyer.
“He had guns that were not registered in New Jersey,” Mr. Lisa said. “He was facing the possibility, if convicted, of spending the rest of his life in prison.”
The judge in the case, Mitzy Galis-Menendez of Hudson County Superior Court, is to sentence Mr. Cramsey on Sept. 22.
Mr. Cramsey has said the intended rescue was part of his anti-heroin activism, which began after his 20-year-old daughter, Alexandria, died in February 2016 from heroin and fentanyl toxicity, according to the coroner’s office in Lehigh County, Pa.
Her death led Mr. Cramsey to start an anti-heroin group on Facebook and stage interventions, which he said had helped dozens of drug users seek professional help.
This antidrug work, Mr. Cramsey has said, motivated him to drive last summer from Lehigh to Brooklyn to try to save Jenea Patterson, a Pennsylvania teenager who eventually died of an overdose in January.
“It’s a tragedy,” Mr. Cramsey said Monday in court. “I mean, I’ve helped so many people, and everyone that has reached out for help is still with us. That’s one that got away from me. I ask myself, ‘What if I would have gotten to her?’ all the time.”
Mr. Cramsey, from Zionsville, Pa., was pulled over because of a crack in his truck’s windshield, the police said. But Mr. Cramsey’s lawyer said that his client was stopped because of the truck’s pro-gun decals, which included a large image of cross hairs.
“I would never turn down somebody for help,” Mr. Cramsey said. “I would be a little more cautious with what I was taking in a vehicle. That’s all I regret. That’s it.”
As part of the guilty plea, Mr. Cramsey forfeited his weapons, but his vehicle will be returned, said Thomas Zuppa Jr., an assistant prosecutor with the Hudson County prosecutor’s office.
The other people in the truck, Dean Smith and Kimberly Arendt, made deals with prosecutors this year to avoid a trial. They were accepted into a pretrial intervention program that could lead to the charges being dropped.
Mr. Lisa said he would ask for a noncustodial sentence so Mr. Cramsey could avoid more prison time.
“He’s done what other people wish they had the courage to do,” Mr. Lisa said. “The fact is that the plea offer was so good that we had to accept it.”