On Monday, law enforcement officials in Utah arrested a teenager after he brought a homemade bomb to school and tried to detonate it, which authorities said would have led to a significant loss of life.

Officials said that the homemade bomb started emitting smoke at Pine View High School, at which point the high school was immediately evacuated and kids were sent home. KUTV reports:

A warrant served at the male juvenile's home and items were found consistent with the materials used to build the device. Police also said the suspect had been researching information and expressing interest in ISIS and promoting the organization.

It was determined that if the device had detonated, it would have caused significant injury or death.

The suspect, whom law enforcement did not identify, was taken into custody and initially charged with manufacture, possession, sale, use or attempted use of a weapon of mass destruction.

The same suspect also allegedly took down an American flag at Hurricane High School and replaced it with an ISIS flag; he allegedly spray-painted on the side of the building "ISIS is comi," as investigators believe the suspect ran off before adding the "ng" to the word.

WATCH: