A teen who was arrested Monday, for replacing the national flag with an Islamic State (ISIS)-like flag and spraying a threatening message on the wall of Hurricane High School, Utah, last month, also left a homemade bomb at the Pine View High School in the same state.

The unidentified teen was arrested at St. George, Utah, after the FBI and the bomb squad were called to the Pine View High School to investigate an explosive device left inside the premises that “had the potential to cause significant injury or death.”

"Based on our investigation we can confirm this was a failed attempt to detonate a homemade explosive at the school. It was also determined that the male had been researching information and expressing interest in ISIS and promoting the organization," police said, NBC News reported. 

The bomb was discovered by a Pine View student Monday afternoon, who immediately alerted a teacher that smoke was coming out of a suspicious backpack.

The school was evacuated for two hours as law enforcement agents investigated the scene. No damages or casualties were reported and the scheduled classes resumed Tuesday morning.

"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, Buzzfeed reported. "Their immediate action played a large role in this incident ending with no injuries."

The suspect was a student at the Pine View High School and was attending classes at the time of his arrest. After executing a search warrant of his home, some items were found that “were consistent with the material used to build the device placed at Pine View," St. George Police Capt. Giles said.

The teen has been linked to a case of vandalism at the Hurricane High School on Feb. 15 — a day after the mass shooting at the Stoneman Douglas High School in Parkland, Florida.

Someone had shredded the American flag that normally graced Hurricane High School’s premises and replaced it with an ISIS-like flag. The suspect had also painted the words “ISIS is comi” on the school building. The investigators believed the student meant to write “ISIS is coming,” but ran out of time.

According to St. Georges’ police, the teen suspect was booked into a detention center on charges of manufacture, possession, sale, use or attempted use of a weapon of mass destruction.

"Charges are pending on our incident here with the flag,” Hurricane police officer Ken Thompson confirmed.

Washington County School district spokesperson Steve Dunham said Monday while the lack of injuries sustained in the particular incident was "a great outcome," the act itself was nerve-wracking.

"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."

Arrest A teen was arrested Monday for making a homemade bomb and planting it at the Pine View High School, Utah. In this representational image, members of the riot police arrest a young man following clashes with demonstrators during a protest against police brutality, following the alleged rape of a black man in Paris, Feb. 23, 2017. Photo: Getty Images/ LIONEL BONAVENTURE