A troubled stranger walks onto school grounds with two guns, a backpack stuffed with ammunition and a plan to kill people.

That all-too-familiar scenario began to play out Monday afternoon at Smith High School in Greensboro.

But thanks to cool heads and quick reactions from school staff and police — and no small measure of divine providence — not one shot was fired and no one was harmed.

After severely beating a woman in Virginia Beach, Va., say police, the intruder, identified as 29-year-old Steve Brantley Spence, stole a 2016 Mercedes and drove it to Greensboro. He arrived on the Smith campus on Holden Road at lunchtime and entered a cafeteria filled with students.

Fortunately, a Smith staff member on lunch-monitor duty spotted Spence and approached him. After Spence lifted his shirt to reveal a handgun, the staff member radioed for help. Spence fled. The school was locked down. Smith’s SRO pursued him, soon to be joined by additional officers. Spence eventually was caught and subdued with a Taser.

Police say Spence didn’t come to the school to randomly target students. He came for someone he knew. According to arrest warrants, Spence had “spontaneously uttered he had arrived at Smith High School to kill two different people.” In fact, he appears to have crafted a detailed plan and a specific list of victims. A warrant says that Spence “had a hit list with at least five people, all of which he was involved in a domestic relationship with” and that he had a “clear, written plan of action” to carry out the killings and escape.

The numbered, handwritten itinerary was chilling in its matter-of-factness. It included not only the names of intended victims but reminders to pick up a “shotgun & 9 mm” and even to “rest” after killing the two people he had targeted in Greensboro — and before setting off to kill someone else in Maryland.

Among the charges Spence faces are two counts of attempted first-degree murder, terrorizing the public and resisting an officer. His hometown newspaper, the Virginian-Pilot in Norfolk, reports that he played football at East Carolina University and later served as an assistant high school football coach in the Hampton Roads area.

Despite his twisted mission to kill people he apparently knew, Spence also placed many others at risk — students, staff and teachers who didn’t know him from Adam.

The outcome could have been unthinkably different. Spence was carrying a loaded 9 mm handgun, a loaded .45-caliber handgun, spare magazines and a backpack “containing eight boxes of bullets,” Greensboro police Chief Wayne Scott said. Further, the stolen car Spence was driving had “an additional long gun in it,” Scott said.

Sad to say, school shootings are a reality today. Guilford County Schools are considering measures to harden campuses against gun violence.

But that’s neither an easy nor an inexpensive proposition. Spence entered the Smith cafeteria through an unlocked door.

School officials say Smith was designed and built in a different time, when mass shootings were not a fact of life (that seems so long ago now).

On Monday, one could have happened here. But school staff and police all did their parts to avert a tragedy. Without their discipline, focus and courage, who knows how this story might have ended?

So we breathe a deep sigh of relief and say to them all: Thank you for our children.

Get today’s top stories right in your inbox. Sign up for our daily morning newsletter.