Whenever an offense defined in this chapter specifies a mandatory sentence of imprisonment which includes a minimum term during which the defendant shall be ineligible for parole, a mandatory extended term which includes a period of parole ineligibility, or an anti-drug profiteering penalty pursuant to section 2 of P.L. 1997, c. 187(N.J.S. 2C:35A-1 et seq.), the court upon conviction shall impose the mandatory sentence or anti-drug profiteering penalty unless the defendant has pleaded guilty pursuant to a negotiated agreement or, in cases resulting in trial, the defendant and the prosecution have entered into a post-conviction agreement, which provides for a lesser sentence, period of parole ineligibility or anti-drug profiteering penalty. The negotiated plea or post-conviction agreement may provide for a specified term of imprisonment within the range of ordinary or extended sentences authorized by law, a specified period of parole ineligibility, a specified fine, a specified anti-drug profiteering penalty, or other disposition. In that event, the court at sentencing shall not impose a lesser term of imprisonment, lesser period of parole ineligibility, lesser fine or lesser anti-drug profiteering penalty than that expressly provided for under the terms of the plea or post-conviction agreement.
N.J.S. § 2C:35-12