A teenage boy who allegedly spray-painted a message about ISIS on a Southern Utah high school building has been arrested for leaving a smoking, potentially deadly homemade bomb on another school campus.

Authorities in Hurricane, Utah, found the bomb on Monday after students at Pine View High School reported "a suspicious backpack that had smoke coming from it," according to a statement from the St. George Police Department. The campus was evacuated and police managed to disarm an explosive device inside the backpack without setting it off.

"After examining the device, bomb squad members indicted that if it had detonated, the device had the potential to cause significant injury or death," police added.

A teenage boy was arrested later that same day after investigators searched his home and found bomb-making materials, according to the police statement. Officials have not named the boy, describing him only as a juvenile male.

St. George police did not respond to BuzzFeed News' request for comment Tuesday evening.

Investigators also believe the boy is the same person who last month swapped out an American flag at another area high school for the flag of ISIS, and who spray-painted "ISIS is comi" on that school's building, Hurricane Officer Ken Thompson said Tuesday. That incident happened just a day after the deadly school shooting in Parkland, Florida.

Following Monday's failed bombing, police said the boy had been "researching information and expressing interest in ISIS and promoting the organization."

Police on Tuesday credited students with helping prevent casualties after the bomb was discovered.

"We’d like to recognize and thank the students who notified faculty and the [school resource officer] of the suspicious backpack," police said in the statement. "Their immediate action played a large role in this incident ending with no injuries."

About 1,100 students attend the school where the bomb was discovered. At a news conference Monday, Washington County School District spokesperson Steve Dunham described the lack of injuries as "a great outcome," but said the incident itself was shocking for the small, mostly rural community.

"It doesn't happen," he said. "And I think it's a shock to all of us that something like this has taken place in one of our schools."

Jim Dalrymple is a reporter for BuzzFeed News and is based in Los Angeles.