(a) No person who has been convicted in this state or elsewhere of committing or attempting to commit a crime of violence, misdemeanor offense of domestic violence, violent offense as listed in Section 12-25-32(15), anyone who is subject to a valid protection order for domestic abuse, or anyone of unsound mind shall own a firearm or have one in his or her possession or under his or her control.
(b) No person who is a minor, except under the circumstances provided in this section, a drug addict, or an habitual drunkard shall own a pistol or have one in his or her possession or under his or her control.
(c) Subject to the exceptions provided by Section 13A-11-74, no person shall knowingly with intent to do bodily harm carry or possess a deadly weapon on the premises of a public school.
(d) Possession of a deadly weapon with the intent to do bodily harm on the premises of a public school in violation of subsection (c) of this section is a Class C felony.
(e) School security personnel and school resource officers qualified under subsection (a) of Section 16-1-44.1, employed by a local board of education, and authorized by the employing local board of education to carry a deadly weapon while on duty are exempt from subsection (c) of this section. Law enforcement officers are exempt from this section, and persons with pistol permits issued pursuant to Section 13A-11-75, are exempt from subsection (c) of this section.
(f) A person shall not be in violation of Section 13A-11-57 or 13A-11-76 and a minor shall not be in violation of this section if the minor has permission to possess a pistol from a parent or legal guardian who is not prohibited from possessing a firearm under state or federal law, and any of the following are satisfied:
(1) The minor is attending a hunter education course or a firearms safety course under the supervision of an adult who is not prohibited from possessing a firearm under state or federal law.
(2) The minor is engaging in practice in the use of a firearm or target shooting at an established range under the supervision of an adult who is not prohibited from possessing a firearm under state or federal law.
(3) The minor is engaging in an organized competition involving the use of a firearm or participating in or practicing for a performance by an organized group under 26 U.S.C. § 501(c)(3) which uses firearms as part of the performance.
(4) The minor is hunting or fishing pursuant to a valid license, if required, and the person has the license in his or her possession; has written permission of the owner or legal possessor of the land on which the activities are being conducted; and the pistol, when loaded, is carried only in a manner discernible by ordinary observation.
(5) The minor is on real property under the control of the minor's parent, legal guardian, or grandparent.
(6) The minor is a member of the armed services or National Guard and the minor is acting in the line of duty.
(7) The minor is traveling by motor vehicle to any of the locations or activities listed in subdivisions (1) through (6), has written permission to possess the pistol by his or her parent or legal guardian, and the pistol is unloaded, locked in a compartment or container that is in or affixed securely to the motor vehicle and is out of reach of the driver and any passenger in the motor vehicle.
(g) This section does not apply to a minor who uses a pistol while acting in self-defense of himself or herself or other persons against an intruder into the residence of the minor or a residence in which the minor is an invited guest.
(h) The term "school resource officer" as used in this section means an Alabama Peace Officers' Standards and Training Commissioner-certified law enforcement officer employed by a law enforcement agency who is specifically selected and specially trained for the school setting.
(i) The term "public school" as used in this section applies only to a school composed of grades K-12 and shall include a school bus used for grades K-12.
(j) The term "deadly weapon" as used in this section means a firearm or anything manifestly designed, made, or adapted for the purposes of inflicting death or serious physical injury, and such term includes, but is not limited to, a bazooka, hand grenade, missile, or explosive or incendiary device; a pistol, rifle, or shotgun; or a switch-blade knife, gravity knife, stiletto, sword, or dagger; or any club, baton, billy, black-jack, bludgeon, or metal knuckles.
(k)(1) The term "convicted" as used in this section requires that the person was represented by counsel in the case, or knowingly and intelligently waived the right to counsel in the case if required by law, and either the case was tried before a judge, tried by a jury, or the person knowingly and intelligently waived the right to have the case tried, by guilty plea or otherwise.
(2) A person may not be considered to have been convicted for the purposes of this section if the person is not considered to have been convicted in the jurisdiction in which the proceedings were held or the conviction has been expunged, set aside, or is of an offense for which the person has been pardoned or has had civil rights restored, unless the pardon, expungement, or restoration of civil rights expressly provides that the person may not ship, transport, possess, or receive firearms.
(l) The term "misdemeanor offense of domestic violence" as used in this section means a misdemeanor offense that has, as its elements, the use or attempted use of physical force or the threatened use of a dangerous instrument or deadly weapon, and the victim is a current or former spouse, parent, child, person with whom the defendant has a child in common, or a present or former household member.
(m) The term "valid protection order" as used in this section means an order issued after a hearing of which the person received actual notice, and at which the person had an opportunity to participate, that does any of the following:
(1) Restrains the person from harassing, stalking, or threatening a qualified individual or child of the qualified individual or person or engaging in other conduct that would place a qualified individual in reasonable fear of bodily injury to the individual or child and that includes a finding that the person represents a credible threat to the physical safety of the qualified individual or child.
(2) By its terms, explicitly prohibits the use, attempted use, or threatened use of physical force against the qualified individual or child that would reasonably be expected to cause bodily injury.
(n) The term "qualified individual" as used in subsection (m), means a spouse or former spouse of the person, an individual who is a parent of a child of the person, or an individual who cohabitates or has cohabited with the person.
(o) The term "unsound mind" as used in this section includes any person who is subject to any of the findings listed below, and who has not had his or her rights to possess a firearm reinstated by operation of law or legal process:
(1) Found by a court, board, commission, or other lawful authority that, as a result of marked subnormal intelligence, mental illness, incompetency, condition, or disease, is a danger to himself or herself or others or lacks the mental capacity to contract or manage his or her own affairs.
(2) Found to be insane, not guilty by reason of mental disease or defect, found mentally incompetent to stand trial, or found not guilty by a reason of lack of mental responsibility by a court in a criminal case, to include state, federal and military courts.
(3) Involuntarily committed for a final commitment for inpatient treatment to the Department of Mental Health or a Veterans' Administration hospital by a court after a hearing.