1. Notwithstanding any other provision of this title, a term of imprisonment must be imposed upon an offender and served without benefit of parole when:
a. In the course of committing an offense, the offender inflicts or attempts to inflict bodily injury upon another, threatens or menaces another with imminent bodily injury with a dangerous weapon, explosive, destructive device, or firearm; or
b. The offender possesses or has within immediate reach and control a dangerous weapon, explosive, destructive device, or firearm while in the course of committing any felony offense under subsection 1, 3, or 7 of section
19-03.1-23.
2. This requirement applies only when possession of a dangerous weapon, explosive, destructive device, or firearm has been charged and admitted or found to be true in the manner provided by law, and must be imposed as follows:
a. If the offense for which the offender is convicted is a class AA, class A, or class B felony, the court shall impose a minimum sentence of four years' imprisonment.
b. If the offense for which the offender is convicted is a class C felony, the court shall impose a minimum sentence of two years' imprisonment.
3. This section applies even when being armed is an element of the offense for which the offender is convicted.
4. An offender serving a sentence subject to this section may be eligible to participate in a release program under section
12-48.1-02 during the last six months of the offender's sentence.