A sixth-grade girl was taken into custody Thursday after shooting three with a handgun that she brought into her school, AP reports.

Jefferson County Sheriff Steve Anderson said the girl pulled the gun out of her backpack in the hallway of Rigby Middle School, firing multiple rounds inside before heading outside. Two students and a custodian were struck, but all are considered to be non-life-threatening injuries.

Both classmates will remain in the hospital overnight, but Dr. Michael Lemon, trauma medical director at Eastern Idaho Regional Medical Center, suspects one of them might require surgery. 

The girl, whose name hasn’t been identified, was disarmed by a teacher, who held her until law enforcement arrived.

Authorities were called to the school at 9:15 a.m. after students and faculty heard gunshots. “Me and my classmate were just in class with our teacher — we were doing work — and then all of a sudden, here was a loud noise and then there were two more loud noises. Then there was screaming,” 12-year-old Yandel Rodriguez said. “Our teacher went to check it out, and he found blood.”

The students managed to evacuate the school and head to a nearby high school where they could be taken home by their parents.

An investigation has been launched to determine the motive behind the attack, and how the girl was able to get a gun. Jefferson County Prosecutor Mark Taylor wouldn't rule out the possibility that she gets charged with three counts of attempted murder. The school was closed in wake of the incident.