In this frame grab from video provided by WPLG-TV, students from the Marjory Stoneman Douglas High School in Parkland, Fla., evacuate the school following a shooting there on Wednesday, Feb. 14, 2018.
WPLG-TV via AP

First came an unexpected fire alarm just before dismissal time. Then gunfire. The shooter, identified by police as a former student, apparently triggered the alarm to stir up the students and create chaos. It worked.

Some students fled screaming. Others huddled in closets or under desks, quietly praying and texting their parents. Wherever they were in a world connected by smartphones and Twitter, the students knew a gunman was on the loose in their midst, but they didn't know where.

"My school is being shot up and I am locked inside," a student named Aidan, aka TheCaptainAidan, tweeted at the height of the ordeal. "I’m f---ing scared right now."

With that, Marjory Stoneman Douglas High School, in Florida's Broward County, became the latest American public school Wednesday to face the numbing ritual of shots fired, panic, followed by lockdown and a class-by-class search for another lone gunman.

More: 'No words': 17 dead in south Florida high school shooting; former student used high-powered rifle

More: Police: Suspect in fatal Florida school shooting is former student

More: Florida high school shooting: Here's what we know

More: Florida school shooting is the 6th to injure students this year

The brother of one student told NBC6 that his sister, a sophomore, was safe but "trembling in shock" as the gunman roamed the halls.

SWAT teams, squad cars and helicopters descended on the school, with special ops officers in camouflage gathering in one nearby fields in what Broward County Public School superintendent Robert Runcie called "just a horrible day for us."

Officers in the field, communicating with the dispatcher, said they were able to track the gunman's movements on closed-circuit surveillance cameras, as he moved from the second floor to the third, and back again. But officers were operating in the blind, since they said there was a 20-minute delay in the footage.

Meanwhile, officers with weapons moved in groups of six into the building. As they moved in, many students moved out. Dressed in various garb — from T-shirts, to jeans, to shorts  — and with packs slung on their backs, teenagers streamed out of the buildings with their arms raised, to show they were victims, not shooters.

Police cautioned fellow officers to check IDs before they allowed students to climb on buses to take them to a rendezvous point a mile away.

Parent John Obin said his son, a freshman at the South Florida high school where the shooting erupted, was in class when he heard several shots. Teachers quickly rushed them outside. 

“This is a really good school, and now it’s like a war zone,” Obin said.

On the streets, another ritual played out: Frantic parents desperate for any word from their kids. As the ordeal unfolded for almost two hours, parents lined the streets for blocks, standing outside their cars, many crying and hugging each other.

While Aidan, a freshman, kept up his tweets of photos from a room where he was locked down, he was also quick to spread the word that the grim ordeal was over. "We have been liberated," he tweeted finally, when the horror lifted. "God bless, America."

Contributing: The Associated Press