TOMS RIVER — An admitted drug dealer who was caught with about 4,150 doses of heroin worth $25,000 was sentenced to just six months of rehab and five years of probation.

Gary Fox, 30, of Toms River, who has a criminal record that includes previous drug convictions, avoided prison by being accepted by Drug Court and pleading guilty to two counts of third-degree possession with intent to distribute and a count of possession.

Fox, however, does face an alternate prison sentence of 10 years in prison with 3 1/2 years of parole ineligibility if he fails to complete the Drug Court program, according to a spokesman for the Ocean County Prosecutor's Office, who added Wednesday that the sentence was not a result of a plea deal with prosecutors.

The Drug Courts, part of Gov. Chris Christie's reform efforts in the wake of a massive heroin addiction epidemic gripping the state, are meant to provide drug users with rehabilitation instead of placing them behind bars. Drug Courts, however, are not for violent or hardened criminals.

The courts found Fox eligible for the program and he began rehab in November, remaining in custody until his guilty plea in January, prosecutors said. Court records show he spent 168 days in county jail.

Toms River police arrested Fox in May, saying he had 80 wax folds of heroin and $740 in cash. A search of his storage unit found an additional 83 bricks of heroin, which amounted to 4,150 doses and a cash value of close to $25,000, police said at the time.

A month later, police at his Old Street home found another 40 wax folds of heroin, more than 1.5 pounds of marijuana, $2,000 in cash, prescription medications, a scale and packaging materials.

Fox was initially charged with possession of heroin, possession of heroin with intent to distribute, possession of over 50 grams of marijuana, possession of marijuana with intent to distribute, possession of Alprazolam and Suboxone, and possession of drug paraphernalia.

He plead guilty to two counts of third-degree possession with intent to distribute and one count of possession.

Police on Tuesday said they could not provide more details about the investigation.

This is not the first time Fox has been sentenced to rehab as a result of drug charges.

In 2009, he received the same sentence from a different judge in Ocean County for arrests in 2006 and 2007 on charges of possession of cocaine and Percocet.

Fox was represented by the Public Defender's Office.

Sergio Bichao contributed to this report.

More From New Jersey 101.5

Contact reporter Adam Hochron at 609-359-5326 or Adam.Hochron@townsquaremedia.com