A school resource officer fatally shot himself at a Maryland high school Monday prompting a brief lockdown, authorities said.

Joseph Comegna, a 21-year veteran of the Baltimore County Police Department, was discovered in his office at the Eastern Technical High School in Essex, Md., with a single gunshot wound, the Baltimore County Police Department said in a statement. Comegna was transported to the MedStar Franklin Square Medical Center where he died.

Surveillance video of the incident showed the officer walking to his office in the school’s basement before faculty members heard a gunshot. Investigators determined the shot was fired from Comegna's duty weapon and officials investigating his death as a suicide.

MARYLAND TEEN SENTENCED TO 25 YEARS FOR INTENTIONALLY RUNNING OVER FELLOW STUDENT

The school was placed on lockdown. Students were dismissed at their usual time.

Comegna worked as a school resource officer at the high school for 12 years and was permanently assigned to the institution for four years. Funeral services were slated to be held Thursday, FOX Baltimore reported.

The Baltimore Sun reported students and faculty were grieving the officer’s death and had placed notes and flowers at his office.

MARYLAND FIRES FOOTBALL COACH DJ DURKIN IN SUDDEN REVERSAL AFTER OUTCRY

“I was thinking of how much I was going to miss him,” Hailie Brown, a sophomore at the school, told the Baltimore Sun. “I figured his family must be suffering too, so I wrote it to them to let them know how much he meant to us.”

The Associated Press contributed to this report.