A. It shall be unlawful for (i) any person who has been convicted of a felony; (ii) any person adjudicated delinquent as a juvenile 14 years of age or older at the time of the offense of murder in violation of § 18.2-31 or 18.2-32, kidnapping in violation of § 18.2-47, robbery by the threat or presentation of firearms in violation of § 18.2-58, or rape in violation of § 18.2-61; or (iii) any person under the age of 29 who was adjudicated delinquent as a juvenile 14 years of age or older at the time of the offense of a delinquent act which would be a felony if committed by an adult, other than those felonies set forth in clause (ii), whether such conviction or adjudication occurred under the laws of the Commonwealth, or any other state, the District of Columbia, the United States or any territory thereof, to knowingly and intentionally possess or transport any firearm or ammunition for a firearm, any stun weapon as defined by § 18.2-308.1, or any explosive material, or to knowingly and intentionally carry about his person, hidden from common observation, any weapon described in subsection A of § 18.2-308. However, such person may possess in his residence or the curtilage thereof a stun weapon as defined by § 18.2-308.1. Any person who violates this section shall be guilty of a Class 6 felony. However, any person who violates this section by knowingly and intentionally possessing or transporting any firearm and who was previously convicted of a violent felony as defined in § 17.1-805 shall be sentenced to a mandatory minimum term of imprisonment of five years. Any person who violates this section by knowingly and intentionally possessing or transporting any firearm and who was previously convicted of any other felony within the prior 10 years shall be sentenced to a mandatory minimum term of imprisonment of two years. The mandatory minimum terms of imprisonment prescribed for violations of this section shall be served consecutively with any other sentence.
B. The prohibitions of subsection A shall not apply to (i) any person who possesses a firearm, ammunition for a firearm, explosive material or other weapon while carrying out his duties as a member of the Armed Forces of the United States or of the National Guard of Virginia or of any other state, (ii) any law-enforcement officer in the performance of his duties, or (iii) any person who has been pardoned or whose political disabilities have been removed pursuant to Article V, Section 12 of the Constitution of Virginia provided the Governor, in the document granting the pardon or removing the person's political disabilities, may expressly place conditions upon the reinstatement of the person's right to ship, transport, possess or receive firearms.
C. Any person prohibited from possessing, transporting or carrying a firearm or stun weapon under subsection A, may petition the circuit court of the jurisdiction in which he resides for a permit to possess or carry a firearm or stun weapon; however, no person who has been convicted of a felony shall be qualified to petition for such a permit unless his civil rights have been restored by the Governor or other appropriate authority. A copy of the petition shall be mailed or delivered to the attorney for the Commonwealth for the jurisdiction where the petition was filed who shall be entitled to respond and represent the interests of the Commonwealth. The court shall conduct a hearing if requested by either party. The court may, in its discretion and for good cause shown, grant such petition and issue a permit. The provisions of this section relating to firearms, ammunition for a firearm, and stun weapons shall not apply to any person who has been granted a permit pursuant to this subsection.
C1. Any person who was prohibited from possessing, transporting or carrying explosive material under subsection A may possess, transport or carry such explosive material if his right to possess, transport or carry explosive material has been restored pursuant to federal law.
D. For the purpose of this section:
"Ammunition for a firearm" means the combination of a cartridge, projectile, primer, or propellant designed for use in a firearm other than an antique firearm as defined in § 18.2-308.2:2.
"Explosive material" means any chemical compound mixture, or device, the primary or common purpose of which is to function by explosion; the term includes, but is not limited to, dynamite and other high explosives, black powder, pellet powder, smokeless gun powder, detonators, blasting caps and detonating cord but shall not include fireworks or permissible fireworks as defined in § 27-95.