(m) Notwithstanding the provisions of paragraph (a) or (h), any person not exempted by statute who knowingly has in his possession, or knowingly has under his control in a vehicle, a large capacity weapon or large capacity feeding device therefor who does not possess a valid Class A or Class B license to carry firearms issued under section 131 or 131F of chapter 140, except as permitted or otherwise provided under this section or chapter 140, shall be punished by imprisonment in a state prison for not less than two and one-half years nor more than ten years. The possession of a valid firearm identification card issued under section 129B shall not be a defense for a violation of this subsection; provided, however, that any such person charged with violating this paragraph and holding a valid firearm identification card shall not be subject to any mandatory minimum sentence imposed by this paragraph. The sentence imposed upon such person shall not be reduced to less than one year, nor suspended, nor shall any person convicted under this subsection be eligible for probation, parole, furlough, work release or receive any deduction from his sentence for good conduct until he shall have served such minimum term of such sentence; provided, however, that the commissioner of correction may, on the recommendation of the warden, superintendent or other person in charge of a correctional institution or the administrator of a county correctional institution, grant to such offender a temporary release in the custody of an officer of such institution for the following purposes only: (i) to attend the funeral of a spouse or next of kin; (ii) to visit a critically ill close relative or spouse; or (iii) to obtain emergency medical services unavailable at such institution. Prosecutions commenced under this subsection shall neither be continued without a finding nor placed on file. The provisions of section 87 of chapter 276 relative to the power of the court to place certain offenders on probation shall not apply to any person 17 years of age or over charged with a violation of this section.
The provisions of this paragraph shall not apply to the possession of a large capacity weapon or large capacity feeding device 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; (iii) any duly authorized law enforcement officer, agent or employee of any municipality of the commonwealth; (iv) any federal, state or local historical society, museum or institutional collection open to the public; provided, however, that any such person described in clauses (i) to (iii), inclusive, is authorized by a competent authority to acquire, possess or carry a large capacity semiautomatic weapon and is acting within the scope of his duties; or (v) any gunsmith duly licensed under the applicable federal law.