12021.1.
(a) Notwithstanding subdivision (a) of Section 12021, any person who has been previously convicted of any of the offenses listed in subdivision (b) and who owns or has in his or her possession or under his or her custody or control, or attempts to purchase or receive any firearm is guilty of a felony. A dismissal of an accusatory pleading pursuant to Section 1203.4a involving an offense set forth in subdivision (b) does not affect the finding of a previous conviction. If probation is granted, or if the imposition or execution of sentence is suspended, it shall be a condition of the probation or suspension that the defendant serve at least six months in a county jail.(b) As used in this section, a violent offense includes any of the following:
(1) Murder or voluntary manslaughter.
(2) Mayhem.
(3) Rape.
(4) Sodomy by force, violence, duress, menace, or threat of great bodily harm.
(5) Oral copulation by force, violence, duress, menace, or threat of great bodily harm.
(6) Lewd acts on a child under the age of 14 years.
(7) Any felony punishable by death or imprisonment in the state prison for life.
(8) Any other felony in which the defendant inflicts great bodily injury on any person, other than an accomplice, that has been charged and proven, or any felony in which the defendant uses a firearm which use has been charged and proven.
(9) Attempted murder.
(10) Assault with intent to commit rape or robbery.
(11) Assault with a deadly weapon or instrument on a peace officer.
(12) Assault by a life prisoner on a noninmate.
(13) Assault with a deadly weapon by an inmate.
(14) Arson.
(15) Exploding a destructive device or any explosive with intent to injure.
(16) Exploding a destructive device or any explosive causing great bodily injury.
(17) Exploding a destructive device or any explosive with intent to murder.
(18) Robbery.
(19) Kidnapping.
(20) Taking of a hostage by an inmate of a state prison.
(21) Attempt to commit a felony punishable by death or imprisonment in the state prison for life.
(22) Any felony in which the defendant personally used a dangerous or deadly weapon.
(23) Escape from a state prison by use of force or violence.
(24) Assault with a deadly weapon or force likely to produce great bodily injury.
(25) Any felony violation of Section 186.22.
(26) Any attempt to commit a crime listed in this subdivision other than an assault.
(27) Any offense enumerated in subdivision (a), (b), or (d) of Section 12001.6.
(28) Carjacking.
(29) Any offense enumerated in subdivision (c) of Section 12001.6 if the person has two or more convictions for violating paragraph (2) of subdivision (a) of Section 417.
(c) Any person previously convicted of any of the offenses listed in subdivision (b) which conviction results from certification by the juvenile court for prosecution as an adult in adult court under the provisions of Section 707 of the Welfare and Institutions Code, who owns or has in his or her possession or under his or her custody or control, attempts to purchase or receive any firearm is guilty of a felony. If probation is granted, or if the imposition or execution of sentence is suspended, it shall be a condition of the probation or suspension that the defendant serve at least six months in a county jail.
(d) The court shall apply the minimum sentence as specified in subdivisions (a) and (c) except in unusual cases where the interests of justice would best be served by granting probation or suspending the imposition or execution of sentence without the imprisonment required by subdivisions (a) and (c), or by granting probation or suspending the imposition or execution of sentence with conditions other than those set forth in subdivisions (a) and (c), in which case the court shall specify on the record and shall enter on the minutes the circumstances indicating that the interests of justice would best be served by the disposition.