There were no immediate official reports of casualties in the shooting at Great Mills High School, located about a 90-minute drive southeast of the US capital Washington.
St. Mary's County Public Schools said on its website that the school was on lockdown and the incident had been "contained" but provided no further details.
It said law enforcement was on the scene.
"It happened really quickly, right after school started" after 8:00 am (1200 GMT), Jonathan Freese, a student at the school, told CNN.
"The police came and responded really quickly," Freese said. "They had a lot of officers respond."
"Right now, the police are going through classrooms," he said. "Soon we are going to be escorted from the school."
The Great Mills incident comes about five weeks after a shooting at a Florida high school left 14 students and three adult staff members dead.