A substitute teacher and custodian are being called heroes after they helped saved lives when a gunman entered a New Mexico high school on Thursday, killing two students.
Casey Jordan-Marquez and Francisco Fernandez were both killed when 21-year-old William Atchison, who entered the school posing as a student, opened fire inside Aztec High School and then later turned the gun on himself.
San Juan County Sheriff Ken Christesen said Friday that more people may have been killed were it not for the "swift action" of custodian Thomas Hill, who pursued the gunman and yelled "lockdown" and "active shooter" through the hallways.
The staff quickly went into lockdown after the alert and those actions "saved a whole bunch of lives and a lot of devastation," police said.
RELATED: Worst school shootings or massacres in U.S. history
Worst school shootings or massacres in U.S. history
Worst school shootings or massacres in U.S. history
Bath Consolidated School bombing in Bath Township, Michigan -- 45 killed (including perpetrator), 58 injured on May 18, 1927
Virginia Tech in Blacksburg, Virginia -- 33 killed (including shooter), 23 injured on April 16, 2007
Virginia Tech students gather at a makeshift memorial Monday, April 16, 2007, on campus following a shooting that killed more than 30 people on campus earlier in the day. (Photo by Ted Richardson/Raleigh News & Observer/MCT via Getty Images)
Sandy Hook Elementary in Newtown, Connecticut -- 28 killed (including shooter), 2 injured on December 14, 2012
Residents grieve following a shooting December 14, 2012 at Sandy Hook Elementary School on December 14, 2012 in Newtown, Connecticut. At least 26 people, including 20 young children, were killed when a gunman assaulted the school and another body was found dead at a second linked crime scene, police said. Police spokesman Lieutenant Paul Vance told reporters that the attacker killed 20 children and six adults, including someone that he lived with, at the Sandy Hook Elementary School in Newtown, Connecticut. The gunman also died at the scene, and a 28th body was found elsewhere. AFP PHOTO / Don EMMERT (Photo credit should read DON EMMERT/AFP/Getty Images)
University of Texas in Austin, Texas -- 16 killed (including shooter), 32 injured on August 1, 1966
Police officer Ramiro Martinez (left) at a press conference after he and other officers shot student Charles Whitman (1941 - 1966) dead after Whitman went on a shooting spree at the University of Texas at Austin, 1st August 1966, killing 15 and wounding 31. (Photo by Shel Hershorn/Hulton Archive/Getty Images)
Columbine High School in Columbine, Colorado -- 15 killed (including gunmen), 24 injured on April 20, 1999
Police officers gather in front of Columbine High School, in Littleton, CO, before searching the building to insure that it was secure 20 April 1999, following a shooting spree by two masked teenagers. As many as 25 students were killed when two gunmen opened fire on students inside the school building, before turning their weapons on themselves in the rampage. AFP Photo by Mark LEFFINGWELL (Photo credit should read MARK LEFFINGWELL/AFP/Getty Images)
Umpqua Community College in Roseburg, Oregon -- 10 killed (including shooter), 9 injured on October 1, 2015
Led by chaplain Toni New, a chaplain for the Billy Graham rapid response team, friends of the late Rebecka Ann Carnes, one of the Umpqua community college shooting victims, embrace each other for an emotional prayer at a memorial service in Winston, Ore., on Oct. 3, 2015. (Marcus Yam / Los Angeles Times via Getty Images)
Red Lake High School in Red Lake, Minnesota -- 10 killed (including shooter), 5 injured on Marck 21, 2005
This Red Lake Net News internet webpage photo captured 22 March, 2005 shows people and emergency vehicles outside of the Red Lake Senior High School in Red Lake, Minnesota. A teenage student went on a shooting rampage at an Indian reservation 21 March, killing his grandparents at their home and then seven people at his school, grinning and waving as he fired, authorities and witnesses said. The suspect apparently killed himself after exchanging gunfire with police. The shooting is the worst US school massacre since Columbine in 1999, police and local media said 22 March. AFP PHOTO/DSK (Photo credit should read DSK/AFP/Getty Images)
Oikos University in Oakland, California -- 7 killed, 3 injured on April 2, 2012
Bodies of the shooting victims at Oikos University are covered with tarps on the ground as police survey the scene on April 2, 2012 in Oakland, California. According to the Oakland Police Department, the shooting suspect is believed to be in custody. (Photo by Jed Jacobsohn/Getty Images)
Isla Vista killings near University of California at Santa Barbara -- 7 killed (including gunman), 14 injuted on May 23, 2014
Two men kneel at a makeshift memorial after a killing rampage May 24, 2014 left seven people dead, in Isla Vista near Santa Barbara California May 24, 2014. Authorities said the 22-year-old lone gunman, Elliot Rodger the son of a director who worked on the 'The Hunger Games' killed six people. Rodger also died in the attack. (Photo by ROBYN BECK/AFP/Getty Images)
Poe Elementary School bombing in Houston, Texas -- 6 killed (including perpetrator), 19 injured on September 15, 1959
Northern Illinois University in DeKalb, Illinois -- 6 killed (including shooter), 17 injured on February 14, 2008
A memorial to slain students sits near Cole Hall on the campus of Northern Illinois University February 15, 2008 in DeKalb, Illinois.Six people were killed including the gunman and 16 others were wounded after University of Illinois graduate student Stephen Kazmierczak opened fire with a shotgun and three handguns inside a lecture hall. This is the fourth shooting at a U.S. school within a week. (Photo by Scott Olson/Getty Images)
Westside Middle School shooting in Jonesboro, Arkansas -- 5 killed, 10 injured on March 24, 1998
Flower covered graveside of slain teacher Shannon Wright who died protecting student during March 24 shooting attack at Jonesboro Westside Middle School by peer gunmen Mitchell Johnson, 13, & Drew Golden, 11. (Photo by Barbara Laing/The LIFE Images Collection/Getty Images)
West Nickel Mines School in Nickel Mines, Pennsylvania -- 6 killed (including gunman), 5 injured on October 2, 2006
Investigators search the one-room West Nickel Mines Amish School 03 October 2006 in the town of Nickel Mines, Pennsylvania. According to officials a milk truck driver identified as Charles Carl Roberts IV entered the schoolhouse, let the boys and adults go free, tied up the girls and shot them execution style before committing suicide. Five girls were killed and at least seven others injured. AFP PHOTO/Stan HONDA (Photo credit should read STAN HONDA/AFP/Getty Images)
Santa Monica shooting in Santa Monica, California -- 6 killed (including gunman), 2 injured on June 7, 2013
Investigators look around near the scene of two shooting fatalities and a possible suspicious package after multiple shootings took place at various locations including Santa Monica College June 7, 2013 in Santa Monica, California. According to reports, at least six people have died in the shootings. (Photo by David McNew/Getty Images)
Thurston High School in Springfield, Oregon -- 4 killed (2 elsewhere), 25 injured on May 20-21, 1998
A police officer walks past the entrance of Thurston High School 22 May as the investigation continues following a fatal shooting the previous day. Fifteen-year-old Kipland Philipp Kinkel killed two fellow students and injured twenty-three others 21 May after he entered the school's cafeteria with a semi-automatic rifle and two hand-guns. AFP PHOTO Hector MATA (Photo credit should read HECTOR MATA/AFP/Getty Images)
Marysville Philchuck High School in Marysville, Washington -- 5 killed (including shooter), 3 injured on October 24, 2014
Women read memorial messages on the memorial wall at Marysville-Pilchuck High School, under the school sign. Taken on 11/1/2014. (Stephen Ehlers via Getty Images)
Discover More Like This
BACK TO SLIDE
A 74-year-old substitute teacher, Katie Potter, also heard the gunshots in the building and barricaded her 17 students in the classroom’s office with a couch.
“I heard popping sounds down the hall, going pop, pop, pop. I looked in the hall and the custodian, Hill, was in the hall and he was saying, who are you? I could tell he was frantic and I knew what was going on,” Potter told reporters.
Police said the shooter came into the room where the students and Potter were and yelled “I know you are in there” before firing multiple rounds through walls. No one was hit.
“We're blessed the good Lord had his angels watching over those kids and that teacher,” Christesen said.
Fernandez had left Potter’s classroom that morning to go the bathroom and never came back, reports said. The shooter was allegedly inside the bathroom when Fernandez walked in. Atchison killed Marquez when he saw her in the hallway, police said.
Law enforcement arrived on the scene in less than one minute and were able to enter the school through windows and doors.
Authorities said the gunman had written a schedule for the day of the shooting that was later found at his home.
San Juan County Sheriff’s Office
Police also found a thumb drive that he carried with him that detailed his plans.
Atchison, who was a previously a student at the school, reportedly had no criminal history but was investigated by the FBI in 2016 after he made an online inquiry about where to find cheap assault rifles for a mass shooting.
Police said Atchison claimed he had made the post as an Internet troll and they ended the investigation.