Students huddled together in classrooms, hiding and attempting to stay silent Thursday after learning that a lockdown at New Mexico’s Aztec High School was the result of a gunman on campus and not a drill.

>> Read more trending news

Two people, identified by authorities as high school senior Casey Marquez and junior Francisco “Paco” Fernandez, were killed when a gunman opened fire at the school in rural Aztec just before 8 a.m. Thursday. Authorities said Friday that the gunman, identified as 21-year-old William Atchison, planned his attack beforehand and is believed to have killed himself after shooting Marquez and Fernandez.

Freshman Makenzie Rezac told The Arizona Republic that she and her classmates stayed in their seats when they heard that they were in lockdown. It wasn't until an announcer came over the school's intercom system -- warning that the lockdown was not a drill -- that students realized the severity of the situation.

Rezac told the Republic that she heard gunshots from far away coming closer.

"I’ve never heard gunshots before in person," she said. "We all thought maybe someone was going around banging on lockers, trying to scare us, or moving furniture. … When it came closer, I was like, 'Oh God, what’s going to happen? Is someone going to break in or shoot through the walls?' I was terrified. I was crying."

Sophomore Garrett Parker told KOAT that he was in a history class when he heard what sounded "like kids were just banging on the lockers."

“It started getting closer and louder, and it was obvious it was gunshots. We could hear gunshots from right outside our door,” Parker said. “At first, all I could think is, ‘This is it, if whoever comes in, I’m probably done.’”

He and his classmates gathered in a corner of the classroom as the shooting continued. When it was deemed safe enough for students to leave the classroom, Parker said he saw “right outside the door … someone lying dead.”

"I don't know who it was," he told KOAT. "It's so hard, I just pray."

Senior Bryn Divine told The Associated Press that she initially thought she was hearing a metal baseball bat hitting lockers when gunshots erupted down the hall from her history classroom Thursday morning.

"I stayed in my desk and I just prayed, 'Please just let this be over as soon as possible,'” she told the AP. “That was my first reaction.”

Aztec is a rural town of 6,500 people in the heart of northwestern New Mexico's oil and gas country and near the Navajo Nation. Its main street is lined by old brick buildings that date back more than a century.

Residents voiced disbelief on social media, while members of the New Mexico congressional delegation, state Attorney General Hector Balderas and other elected officials offered their condolences and other assistance.

"You hope that nothing ever happens at a school," Aztec School superintendent Kirk Carpenter said Thursday, according to the Farmington Daily Times. "But when it does, it's (the) reaction, and our staff, even substitutes, reacted in a way that honestly saved a lot of lives. … We lost lives. … But to see the way people came together ... the response from law enforcement and this community is amazing."

Local, state and federal authorities said Thursday at a news conference that they had a lot of evidence to process and many interviews to conduct. They also were asking any students who might have seen something to call police.

Authorities continued Friday to investigate the circumstances that led to the shooting.

The Associated Press contributed to this report.