This is an archived article and the information in the article may be outdated. Please look at the time stamp on the story to see when it was last updated.

BOISE, Idaho (AP) — A sixth-grade girl brought a gun to her Idaho middle school, shot and wounded two students and a custodian and then was disarmed by a teacher Thursday, authorities said.

The three victims — two students and a custodian — were shot in their limbs and expected to survive, officials said at a news conference. 

Both of the students who were shot were being held at the hospital, and one of them might need surgery, said Dr. Michael Lemon, trauma medical director at Eastern Idaho Regional Medical Center. Still, both students were in fair condition and could be released as early as Friday. One of the students had wounds in two limbs and might have been shot twice, he said.

“It’s an absolute blessing” that they weren’t hurt worse, Lemon said. The adult was treated and released for a bullet wound that went through an extremity, the doctor said.

Police were called to the school around 9:15 a.m. Multiple law enforcement agencies were on scene. Students were evacuated to a nearby high school, and parents lined up to be reunited with their children.

Jefferson County Sheriff Steve Anderson says the girl pulled a handgun from her backpack and fired multiple rounds inside and outside Rigby Middle School in the small city of Rigby, about 95 miles (145 kilometers) southwest of Yellowstone National Park.

“Today we had the worst nightmare a school district could encounter. We had a school shooting here at Rigby Middle School,” Jefferson School District Superintendent Chad Martin said. “What we know so far is the shooter has been apprehended. There is no further threat to the students.”

A female teacher disarmed the girl and held her until law enforcement arrived and took her into custody, authorities said, without giving other details. Authorities say they’re investigating the motive for the attack and where the girl got the gun.

“We don’t have a lot of details at this time of ‘why’ — that is being investigated,” Anderson said. “We’re following all leads.”

The girl is from the nearby city of Idaho Falls, Anderson said. He didn’t release her name.

Jefferson County Prosecutor Mark Taylor said decisions about criminal charges wouldn’t be made until the investigation is complete but that they might include three counts of attempted murder.

Rigby Middle School has about 1,500 students in sixth through eighth grades, according to the National Center for Education Statistics.

“I am praying for the lives and safety of those involved in today’s tragic events,” Gov. Brad Little said in a prepared statement. “Thank you to our law enforcement agencies and school leaders for their efforts in responding to the incident.”

The president of the Idaho Education Association, Layne McInelly, said the union was ready to provide whatever support school staffers, students and the community needs.

“We send positive thoughts to the victims of this tragic incident and hope for their full and rapid recovery. Patience will need to be at a premium while school officials and law enforcement agencies investigate the situation,” McInelly said in a statement.

The Associated Press contributed to this report.