Parents and students try to reunite after a student was shot and critically wounded on the first day of classes at Perry Hall High School, Monday. A suspect was taken into custody shortly after the shooting, according to police.Photo: AP

PERRY HALL, Md. — A 15-year-old student opened fire on the first day of classes Monday at a Baltimore County high school, getting off two shots and wounding a classmate before being rushed by teachers, authorities said.

Baltimore County Police Chief James Johnson said at a news conference that officers do not believe the victim, a 17-year-old male, was targeted by the shooter, a 15-year-old who is also a student at Perry Hall High School. A male suspect was taken into custody after the shooting, and police have the weapon, although police would not say what kind of gun it was.

Johnson said at about 10:45 a.m., a student walked into the cafeteria and pulled out a gun. He fired one shot before being grabbed by teachers, and then another shot went off as teachers grabbed him, Johnson said.

Kelsey Long, a junior at Perry Hall, said she was in the cafeteria when she heard gunshots.

“I heard a loud popping noise and we thought it was someone popping a bag, but then we heard it again and everyone started screaming and ran out to the front of the school,” Long told The Associated Press in a Twitter message.

Police said several other students suffered minor, non-shooting injuries during the incident.

Johnson said the suspect acted alone. He did not answer numerous questions from reporters about a motive.

The school was evacuated, and students were escorted to a nearby shopping center and middle school.

WJZ-TV showed video of a shirtless male with his hands behind his back being put into a police cruiser.

Perry Hall is a middle-class community along the Interstate 95 corridor, northeast of Baltimore city. The school is the largest in the county, with 2,200 students.

County Councilman David Marks, who lives next door to the school, said he had received dozens of phone calls and text messages from worried parents and residents.

“This is a very comfortable, very safe community, and it’s an excellent high school,” said Marks, who graduated from Perry Hall. “I think this is an aberration, but clearly one that is horrifying, particularly on the first day of school.”

Television coverage showed scores of police cars surrounding the school and parked on neighborhood streets. A group of officers with weapons drawn staked out a corner of the building, one of them lying prone on the ground and appearing to cover a particular area of the campus. Hundreds of students streamed away from the school toward a nearby shopping center where they met their parents.

Cathy Le, 15, said students were panicking as they tried to find out what was happening, texting and calling each other frantically as they waited in lockdown.

Le said she and other students were locked in their classrooms for more than an hour.

At the scene, buses, emergency vehicles and parents in cars filled the roadway between the high school and the shopping center. There were obvious signs of relief displayed as parents found their children.

Kristin Kraus, whose son James attends the school, described hearing about the shooting as “absolute terror.” However, Kraus said, “within a couple of minutes he texted my husband that he was OK.”