Section 12D. (a) Except as exempted or provided by law, no person shall carry on his person on any public way a loaded rifle or shotgun having cartridges or shells in either the magazine or chamber thereof. For purposes of this section, ''loaded shotgun or loaded rifle'' shall mean any shotgun or rifle having ammunition in either the magazine or chamber thereof, such ammunition including a live cartridge, primer (igniter), bullet or propellant powder designed for use in any firearm, rifle or shotgun and, in the case of a muzzle loading or black powder shotgun or rifle, containing powder in the flash pan, a percussion cap and shot or ball; but the term ''loaded shotgun or loaded rifle'' shall not include a shotgun or rifle loaded with a blank cartridge, which contains no projectile within such blank or within the bore or chamber of such shotgun or rifle.
Whoever violates the provisions of this subsection shall be punished by a fine of not less than $500 nor more than $5,000 or by imprisonment in the house of correction for not more than two years, or by both such fine and imprisonment, and may be arrested without a warrant; provided, however, that if such rifle or shotgun is a large capacity weapon, as defined in section 121 of chapter 140, such person shall be punished by a fine of not less than $1,000 nor more than $10,000 or by imprisonment for not less than one year nor more than ten years, or by both such fine and imprisonment, and may be arrested without a warrant.
(b) Except as exempted or provided by law, no person shall carry on his person on any public way an unloaded rifle or shotgun, unless such rifle or shotgun is enclosed in a case.
Whoever violates the provisions of this subsection shall be punished by a fine of not less than $100 nor more than $1,000, and may be arrested without a warrant; provided, however, that if such unloaded rifle or shotgun is a large capacity weapon and is carried simultaneously with a fully or partially loaded large capacity feeding device, such person shall be punished by a fine of not less than $1,000 nor more than $10,000 or by imprisonment for not less than one year nor more than ten years, or by both such fine and imprisonment, and may be arrested without a warrant.
This subsection shall not apply to drills, parades, military reenactments or other commemorative ceremonies, color guards or memorial service firing squads, so-called, as permitted by law.
(c) Upon a conviction of a violation of any provision of this section, such rifle or shotgun shall be confiscated by the commonwealth and, upon written order of the court, such weapon shall be forwarded to the colonel of the state police, who may dispose of such weapon in the manner prescribed in section 10.
(d) The provisions of this section shall not apply to the carrying of a loaded or unloaded rifle or shotgun on a public way by (i) any officer, agent or employee of the commonwealth or any other state or the United States, including any federal, state or local law enforcement personnel; (ii) any member of the military or other service of any state or the United States, including members of the national guard, reserves and junior reserve officer training corps; (iii) any duly authorized law enforcement officer, agent or employee of any municipality of the commonwealth; provided, however, that any such person described in clauses (i) to (iii), inclusive, shall be authorized by a competent authority to so carry a loaded or unloaded rifle or shotgun on a public way and such person is acting within the scope of his duties or training; or (iv) a person who is lawfully engaged in hunting and is the holder of a valid hunting or sporting license issued pursuant to chapter 131. This section shall not apply to the operation of a shooting gallery, licensed and defined under the provisions of section 56A of chapter 140, nor to persons using the same.