After the deadly Feb. 14, 2018, mass shooting at Marjory Stoneman Douglas High School in Parkland, Fla., national media focused largely on a handful of student activists, leaving it to victims’ parents to unravel why the slaughter happened. Andrew Pollack, whose daughter, Meadow, was one of the 17 killed, conducted his own investigation to uncover the roots of what he calls the most avoidable mass murder in American history. He and Max Eden are co-authors of “Why Meadow Died: The People and Policies that Created the Parkland Shooter and Endanger America’s Students.” This adapted excerpt, based on never-before-released educational records of the shooter, Nikolas Cruz, shows the Broward County school district knew full well about his obsession with guns and murder — and then let him practice shooting at school.

When staff at Westglades Middle School heard that Nikolas Cruz had committed the massacre at Marjory Stoneman Douglas High School, some couldn’t believe it. The fact that he was a mass murderer wasn’t what surprised them, but rather the fact that he had attended that school.

“How is that possible?” one Westglades educator recalled thinking. “We did our jobs. It took forever, but we got him [to the specialized school] where he needed to go. We couldn’t believe they ever let him into [Douglas].”

Westglades students and staff had never seen anyone like Nikolas Cruz. One student, Paige, recalled the time that she met Cruz. They were standing outside their classroom waiting for their teacher to open the door, and Cruz offered her a hug, which Paige accepted. Their teacher later pulled Paige aside and warned her, “Don’t touch him. He just got caught jerking off.”

If something frustrated Cruz, he would curse and threaten anyone nearby. He would hide behind corners and doors, jump out and scream at people, and then cackle at their fear. Sometimes, for no apparent reason, he would burst into maniacal laughter.

Another student, Sarah, recalled a time when he threw his chair across a classroom. Later, she saw him sitting outside the classroom with his desk tied down.

Cruz’s torture and killing of animals became a source of pride for him as he interacted with other students. One student, Devin, recalled that, although he tried to avoid Cruz, Cruz would approach him almost every day and ask, “Would you like to see videos of me skinning animals?” Devin always declined, but Cruz kept asking.

Cruz’s records suggest that his reign of terror at Westglades Middle School began halfway through his seventh-grade year, in February of 2013. For the next calendar year, Cruz was suspended every other day. Why did the school allow him to remain enrolled despite his daily, deranged behavior for a full year? Not by negligence, but by policy.

Students with disabilities are supposed to be educated in the “least restrictive environment” possible, regardless of whether their disability is that they’re dyslexic or a psychopath, and the paperwork requirements to send them to a specialized school can take many months.

Cruz’s eighth-grade language arts teacher, Carrie Yon, kept diligent notes on his behavior for Cruz’s “Functional Behavior Analysis”:

Sept. 3: While reviewing [a] homophones worksheet, when another student mentioned the amendment that talks about ‘the right to bear arms’ Nick [sic] lit up when hearing the word that related to guns and shouted out “you mean like guns!” he was overly excited thinking that we were going to talk about guns. Nick later used his pencil as a gun … shooting around the classroom.

Sept. 4: Nick drew naked stick figures (showing body parts, sexual) and drew pictures of people shooting each other with guns.

Sept. 11: After discussing and lecturing about the Civil War in America Nick became fixated on the death and the assassination of Abraham Lincoln. He asked inappropriate questions and was making shooting actions with his pencil. Some questions he asked were “What did it sound like when Lincoln was shot? Did it go pop pop or pop pop pop really fast? Was there blood everywhere? After the war what did they do with all the bodies? Did people eat them?”

Sept. 16: When we began to read the Odyssey Nick paid partial attention (in-and-out) until we came up to the gruesome scene when the giant eats Odysseus’ crew members, only then Nick was interested in the lesson and got my 100% attention.

Sept. 27: Another student also informed me (once Nick was escorted out of class) that Nick asks him all of the time “How am I still at this school?”

Oct. 1: When talking about figurative language and onomatopoeias, Nick shouted out “Like a gun shooting.” Nick will find any excuse to bring up shooting guns or violence … He got frustrated and said “I hate security, I hope they die.” Then he stated to me, “F- -k you.” I called security to pick him up immediately.

Oct. 15: Spoke to his mother … We discussed that he should not be playing violent video games and that he should be put in a different school that can help with his behavior and emotional issues. We also discussed his obsession with guns/violence. She stated that he is interested in buying a BB gun from Walmart and was asking his mom, repeatedly, if he could get the gun, promising that he would “just shoot at trees.”

Oct. 17: Nick began reading the last couple of pages out to the students, intentionally trying to ruin the book for everyone else. I asked him to stop and he told me that he dislikes the book and then he stated, “I like guns” can we talk about that. Then he continued to read the book out loud again.

On Oct. 24, Assistant Principal Antonio Lindsay came to class to observe Cruz. As soon as Lindsay left the room, Cruz yelled, “Yes, now I can talk!” He continued to be disruptive, and Yon said, “I know that you can behave. I have seen you. You’re a good kid.” Cruz shouted, “I’m a bad kid! I want to kill!”

Yon provided her opinion for the “Functional Behavioral Analysis”:

“I feel strongly that Nikolas is a danger to the students and faculty at this school. I do not feel that he understands the difference between his violent video games and reality. He is constantly showing aggressive behavior and poor judgment. His drawing in class show violent acts (people shooting at each other) or creepy sexual pictures (dogs with large penises) … I would like to see him sent to a facility that is more prepared and has the proper setting to deal with this type of child.”

On Sept. 13, 2013, Lindsay emailed teachers to inform them that if Cruz “needs to leave the class to use the restroom, go to the clinic, or any other reason please notify the front office and wait for a security escort. Under no circumstances should Nickolas [sic] be allowed to leave a supervised setting without an escort.”

In October, Lindsay sent a follow-up email informing teachers that moving forward, “Cruz will be ‘shadowed’ by his mother when he chooses to run/walk out of class in ‘his attempts’ of avoiding getting into trouble.” Teachers were advised to call security in secret by sending a student to the office on another pretext.

On Nov. 4, after two months of gathering “data” for Cruz’s “Functional Behavior Assessment,” teachers were sent his “Positive Behavior Intervention Plan.” The plan included helpful tips, like:

If Nikolas destroys property at a lower level,

Calmly let him know he has not followed one of the expectations. Remind him what he is working for.

Prompt him to use a cool down pass and walk away to diffuse [sic] the situation.

If Nikolas engages in major disruption/property destruction:

Let Nikolas know, “you’re getting too loud. I need for you to get back into control by using a cool down pass or calming down at your desk. If you get back into control, you can stay in class. If you continue, I’ll need for you leave [sic].”

Walk away and do not pay attention to his behavior.

Do not argue with Nikolas or engage with him.

When class is over, Nikolas needs to go to his next class and behavior plan should re-set with able to [sic] earn reward breaks again.

Teachers were required to implement this plan for at least six weeks until Cruz could become eligible for further evaluation. In late November, Cruz attempted to commit suicide at school by running into oncoming traffic. But that did not accelerate the process.

School administrators classified the incident as “minor disruption,” and Cruz remained enrolled at Westglades for another three months. As Yon’s records show, even Cruz couldn’t understand why they kept him there for so long.

Cruz enrolled in Cross Creek, a specialized school serving 150 students in grades K-12, in February of 2014. For the first semester, his behavior remained much the same. Dr. Nyrma Ortiz, a psychiatrist who consults with Cross Creek, noted, “He goes to YouTube to research wars, military material, and terrorist topics. Wears military related items before he goes to school. Parent stated that all of these ideas are related to his excessive gaming.” When prompted to describe a perfect summer, Cruz wrote, “Buying some type of gun and shooting at targets that I set up with large amounts of ammo just for fun for hours.”

Shortly before summer break, Ortiz and Cruz’s therapist Rona Kelly took the extremely unusual step of writing to his private psychiatrist:

“Dear Dr. Negin,

“We are witting [sic] you with his mother’s consent, to inform you of some of the behavioral problems he continues to display at home and school. Nikolas continues to present with extreme mood liability. He is usually very irritable and reactive. In school he displays oppositional and defiant behaviors and has become verbally aggressive in the classroom. He seems to be paranoid and places the blame on others for his behavioral problems. He has a preoccupation with guns and the military and perseverates on this topic inappropriately. At home, he continues to be aggressive and destructive with minimal provocation. For instance, he destroyed his television after loosing [sic] a video game that he was playing. Nikolas has a hatchet that he uses to chop up a dead tree in his backyard. Mom has not been able to locate that hatchet as of lately [sic]. When upset he punches holes in the walls and has used sharp tools to cut up the upholstery on the furniture and carve holes in the walls of the bathroom. Per recent information shared in school he dreams of killing others and [being] covered in blood. He has been assessed for the need of hospitalization in school and by the YES team from Henderson Behavioral Health … We would like you to be aware of the current concerns since you will see him for medication management during the summer and may need to re-assess his respond [sic] to the current medications. In our opinion his response to medications has been limited at best.”

The next fall, Kelly called Cruz’s mom and “shared concerns with parent about obsession with guns/military and his poor anger control. He continues to deploy aggressive behaviors at home. Parent was advised against getting him a gun (pellet) or [shooting] classes for his birthday. Parent advised to restrict access to any weapons.”

When Cruz’s teachers were asked what he was interested in or enjoyed, almost every single one mentioned guns, the military, or war.

But from October onwards, Cruz appears to have calmed down for a few months, and that was enough to earn him a ticket to Marjory Stoneman Douglas. In April, he told Ortiz that he wanted to enroll in the high school Junior Reserve Officer Training Core program.

Ortiz recorded, “interested in [J]ROTC? — not advised … Discussed the safety of others/himself.”

But the next month, every member of Cruz’s “Child Study Team” recommended that he be mainstreamed for two class periods a day at the beginning of the 2015-16 school year: for one class to be determined and JROTC.

Nikolas Cruz couldn’t possibly have made himself any clearer. Broward schools staff knew exactly who and what he was. Yet they not only allowed him to enroll in Marjory Stoneman Douglas, they literally gave him an air gun, shaped like an AR-15, and let him practice shooting.

This may sound astonishing. But it was all according to policy. The official review of Nikolas Cruz’s educational history registered no objections to anything you just read.

Excerpted from “Why Meadow Died: The People and Policies That Created The Parkland Shooter and Endanger America’s Students” (Post Hill Press), out Tuesday.