A former prosecutor who authorities said sold confidential law enforcement to his drug supplier to feed his oxycodone habit has been sentenced to five years of probation.

Thirty-five-year-old Stephen Gilpatric was sentenced Friday in Middlesex Superior Court after pleading guilty to charges including unlawfully communicating criminal offender record information. He also admitted receiving an unlawful $1,500 payment from a woman who wanted her son’s driver’s license restored.

Gilpatric worked in the Middlesex County District Attorney’s Office from 2007 until October.

Gilpatric’s attorney, Melinda Thompson, said Gilpatric became addicted to prescription drugs and is now seeing a psychiatrist for addiction and depression.

Prosecutors said Gilpatric was spending hundreds of dollars a week on oxycodone. Thompson said Gilpatric has since beat the habit.

Join our Newsletter for the latest news right to your inbox