OREM, Utah (ABC4) — A man was arrested Wednesday for allegedly entering Orem Junior High with a knife while high on drugs, leading the school to be placed under lockdown. The situation was contained in under 10 minutes, officials said.

Alavaro Martinez was booked into the Utah County Jail on charges including possession of a dangerous weapon on school property, criminal trespass on school property, criminal trespass, possession of a controlled substance, intoxication, and obstruction of justice.

According to the Orem Police Department, officers were dispatched to a residence near 750 North 550 West on reports of a man, later identified as Martinez, trying to break into a residence. The homeowner reportedly confronted Martinez and asked him to leave their property, to which he did not comply for at least a few minutes.

As officers were on their way to the scene, Martinez allegedly left the residence and entered Orem Junior High while holding a knife.

The press release states that the employee who reported Martinez was able to talk him into giving up the knife and going inside an office. However, when officers arrived, they found that Martinez was no longer inside the office.

At this point, the school was reportedly placed on lockdown. Since classes had yet to begin, students were ordered to stay in buses and subsequently directed to another building while officers search for Martinez, according to the press release.

Police say they eventually found Martinez hiding in a closet in the school. He allegedly failed to comply with orders to exit the closet initially. After he was taken into custody, officers confirmed that he was under the influence of narcotics.

Classes at Orem Junior High resumed as normal while authorities wrapped up their investigation.

“The Orem Police Department is appreciative of the staff of Orem Junior High for their help in locating, locking down the school, and assisting officers in locating Martinez,” said representatives of the Orem Police Department. “We are happy this incident was contained in under 10 minutes and all the students and faculty are safe.”