QUINCY, Mass. (AP) — Authorities say a 19-year-old man accused of bringing a gun to a high school south of Boston was looking for a 16-year-old girl he met online, but she wasn’t a student there.

Jonathan Villagran of Watertown was ordered held without bail pending a hearing next week during his arraignment Thursday in Quincy District Court. He pleaded not guilty to carrying a firearm on school grounds, possessing marijuana and other crimes.

READ MORE: Local Researchers Test COVID Samples To Determine Prevalence Of Omicron Variant In Massachusetts

Milton High School was locked down for three hours Wednesday afternoon because of the incident.

READ MORE: Amid Concerns Over Omicron COVID Variant, CDC Says All Vaccinated Adults Should Get Booster Shots

Police say Villagran tried to enter the school with a loaded pistol shortly after classes ended for the day and was confronted by the principal, who held him until police arrived.

Authorities say Villagran was carrying a bag containing the pistol, marijuana and vodka.

MORE NEWS: Omicron Variant: Dr. Mallika Marshall Explains What's Known And What's Not

Copyright 2015 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.