Maryland Criminal Law Section 4-102
(a)   This section does not apply to:
(1)   a law enforcement officer in the regular course of the officer's duty;
(2)   a person hired by a county board of education specifically for the purpose of guarding public school property;
(3)   a person engaged in organized shooting activity for educational purposes; or
(4)   a person who, with a written invitation from the school principal, displays or engages in a historical demonstration using a weapon or a replica of a weapon for educational purposes.
(b)   A person may not carry or possess a firearm, knife, or deadly weapon of any kind on public school property.
(c)   (1)   Except as provided in paragraph (2) of this subsection, 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.
(2)   A person who is convicted of carrying or possessing a handgun in violation of this section shall be sentenced under Subtitle 2 of this title.