Maryland Public Safety Section 5-205
§ 5-205.
  (a)   Unless the person possesses a physician's certificate that the person is capable of possessing a rifle or shotgun without undue danger to the person or to another, a person may not possess a rifle or shotgun if the person:
    (1)   suffers from a mental disorder as defined in § 10-101(f)(2) of the Health - General Article and has a history of violent behavior against the person or another; or
    (2)   has been confined for more than 30 consecutive days in a facility as defined in § 10-101 of the Health - General Article.
  (b)   A person who violates this section is guilty of a misdemeanor and on conviction is subject to imprisonment not exceeding 3 years or a fine not exceeding $1,000 or both.