With students off for the Veterans Day holiday, a simulated school shooting at a Methuen grammar school on Tuesday showed what "active shooter" technology could do to help police catch a gunman if the horrible threat ever strikes as it has at other schools across the country.

In the live demonstration, the "gunman" entered the school armed with an assault rifle, opening fire with dummy rounds first in the school library then rampaging through hallways and classrooms. But he had only a few minutes to wreak havoc.

Smoke alarm-sized sensors installed in classrooms, hallways and other points throughout the building were activated by the sounds of gunfire, and police officers were immediately able to track his movements and quickly subdue him.

Nearly 100 people, including U.S. Rep. Niki Tsongas and regional law enforcement officers, gathered in the school auditorium to observe the demonstration of what the school district bills as the first such system operating in a public school in the U.S.

Police Chief Joseph Solomon said he believes such systems should be required in many public buildings, just as fire suppression systems and smoke detectors are.

"It's amazing, the short, split-second amount of time from identification of the shot to transmission of the message," he said following the demonstration. "It changes the whole game. Without that shot detection system, we wouldn't know what was going on in the school ... Valuable, valuable time can be lost. Unfortunately, with school crisis situations, it's about mitigating loss."

School Superintendent Judith Scannell said she hopes the district of about 7,300 students can find the money to pay for outfitting its four other schools.

The new system was installed at no cost by Shooter Detection Systems, a Massachusetts-based company. Company CEO Christian Connors said it is installing the technology in two more schools in Virginia and California, as well as undisclosed airports.

Founded in 2013, the company is among others across the country trying to market such "active shooter" systems to the owners and operators of malls, airports, government offices, schools and other public buildings.

Later this month, Savannah College Art and Design in Georgia is expected to become the first college in the country to launch such technology, using a system developed by SST, a California-based company.

Connors said his company's technology is based on systems successfully developed for the military to help soldiers locate enemy fire during battles and could cost anywhere from $20,000 to $100,000, depending on the size and structure of the building.

Methuen has never been targeted, but three schools briefly were placed on lockdown last month after a psychiatric patient at nearby Holy Family Hospital reported a man with a gun in the clinic.

Methuen long has been among the more active districts in the state in addressing school safety. In a city about 30 miles north of Boston, the district was one of the first to post uniformed police, known as school resource officers, in its schools.

Methuen was also among the first to conduct "active threat" drills for police officers following a rash of school shootings across the country, including the 2012 school shooting in Newtown, Connecticut that killed 26 children and school staff.

Suzanne Kennan, a resident who lives across from the school, said she wasn't aware the district made the upgrade, but supported the investment anyway.

"Unfortunately we're at a point where we have to do something like this," she said. "Instead of burying our heads in the sand and thinking this will never happen, they're doing something. You never know where this is going to happen next. Why take that chance?"