The teenager had a plan.
According to authorities in Waseca, Minnesota, he was going to kill his family, start a diversionary fire, set off bombs at an area school, kill the resource officer there and then shoot students.
Frighteningly, the 17-year-old - who CNN is not naming because of his age - had the resources to carry out such an attack.
But because of watchful eyes, he didn't have the chance and is now behind bars.
"This case is a classic example of citizens doing the right thing and calling the police when things seem out of place. By doing the right thing, unimaginable tragedy has been prevented," the Waseca Police Department said in a Thursday statement.
Police were tipped off to the case two days earlier. Someone called about a suspicious person at a storage facility. When officers arrived, they saw what looked like bomb-making materials in a locker - a pressure cooker, pyrotechnic chemicals, steel ball bearings and gunpowder.
The teen went with officers to the police station for an interview.
There, police say, he told authorities of his plan to kill his mother, father and sister, start a fire in rural Waseca to distract first responders, go to the Waseca Junior and Senior High School, where he planned to set off various bombs during lunch, kill the school resource officer, set fires, and then open fire on students.
A journal recovered from his home detailed his plan and preparations, said police, who believe he meant to carry out the attack in the next week or two.
MORE on CNN.com