ROCKVILLE, Md. (AP) — A student was shot at a Maryland high school Friday afternoon, prompting an hourslong lockdown, authorities said. A suspect was in custody.

A male student was shot on campus at Magruder High School in Rockville, Montgomery County police said in a tweet. School officials said in the late afternoon that the school had been deemed safe by authorities and dismissal would begin. Earlier, television footage had shown numerous squad cars on the scene and officers entering the building.

READ MORE: Hogan Calls On Franchot To 'Halt Or Minimalize' Pending Gas Tax Increase; Comptroller Says Executive Action Is Needed

The injured student was taken to a hospital, police said. A letter to parents from the school principal said the wounded student was in serious condition.

Montgomery County Police Chief Marcus Jones said at a news conference that the student was shot about 1 p.m. and the school was put into lockdown soon after. The suspect, a fellow student, was taken into custody about two hours later during a search of the building, Jones said. The chief said a handgun was found with the suspect.

READ MORE: Roof Partially Collapses At Scene Of Mt. Airy Barn Fire, Authorities Say

Jones said it wasn’t clear what led up to the shooting.

The letter said students who had been locked down in the school would be dismissed starting between 5 and 6 p.m., hours after the lockdown began. County records show the school has approximately 1,700 students.

MORE NEWS: U.S. Naval Academy Plebes Cap First Year With Herndon Climb

“Our goal is to facilitate students’ exiting the building as quickly as possible, but we ask families to be patient as we coordinate with our police partners who remain onsite,” the letter said.

(© Copyright 2022 The Associated Press. All Rights Reserved. This material may not be published, broadcast, rewritten or redistributed.)