He’s famous for his science experiments on YouTube. Now, this Utah man will make videos explaining the dangers of playing with explosives.

Jonathan Grant Thompson, the man behind the popular science-focused YouTube channel The King of Random.

The next time you watch a video from the man behind the popular science-focused YouTube channel King of Random, you might be hearing a message about the danger and legal risks of explosives.

Jonathan Grant Thompson, of South Jordan, has agreed with Utah prosecutors to make at least two YouTube videos discussing “physical safety and/or the legal risks associated with experiments that could be dangerous,” according to a plea in abeyance agreement filed in court Monday. He agreed to make mention of “being considerate of neighbors” in at least one of the videos.

The resolution comes several months after the Salt Lake County District Attorney’s Office charged Thompson with two counts of second-degree felony possession of an explosive device for allegedly conducting incendiary experiments in his backyard on two occasions.

Thompson’s attorney, Steven Burton, said Friday that it was his client’s idea to make the videos — a way to have a positive ending to a case that was “not very well-founded.”

As part of the deal, Thompson on Monday pleaded no contest to a single count of class A misdemeanor recklessness with an incendiary device — but the plea will be held in abeyance, meaning the case will be dismissed after 18 months if Thompson does not break any other laws.

He must also create the two videos and obtain permission in advance from the local fire marshal or federal authorities before conducting experiments that may cause a dangerous fire or explosion.

“[Thompson] also agrees to conduct no experiments and make no videos at his residence which create exceptionally loud noises that are likely to cause alarm to neighbors,” the plea in abeyance agreement reads.

Prosecutors in return have agreed not to file any further charges against Thompson for any other videos that have already been made public.

Burton said Thompson’s plea was for possessing a firecracker in one of his videos — and not in connection to the two instances that initially led prosecutors to file charges.

The defense attorney said his client chose to make videos on those topics to illustrate to viewers the behind-the-scenes safety precautions and to inform them that they should be “extra careful” when using anything that could resemble explosives — and perhaps contact an attorney first.

Burton said police and fire agencies were aware of Thompson’s experiments and his YouTube channel, and it had not been a problem for years. Even after charges were filed, he said, it was unclear what process Thompson should have gone through to get the proper permission.

While Thompson’s channel does include some videos with explosions or fire, there are also many others that show how to do things like making a rope out of a soda bottle or making a silicone mold of a chicken.

Thompson, 37, runs the King of Random YouTube channel, boasting hundreds of videos and more than 9.3 million subscribers. His videos are of science experiments and are in the vein of science-based shows on networks such as the Discovery Channel.

He has been making videos and putting them on YouTube since 2010.

Prosecutors filed charges against Thompson in January in connection to two incidents.

The first count resulted from a citizen complaint via Facebook Messenger last June about Thompson exploding a dry ice bomb, according to a probable cause statement written by a South Jordan police officer.

Then, in late August, police responded to Thompson’s South Jordan home on a report of an explosion, the police report states. Thompson told them he has a YouTube channel where he posts his science experiments, including some with explosions.

He said a friend had left him a bag of powder, which he believed to be from a deconstructed firework.

After lighting a couple of small “control fires,” Thompson and Timothy Burgess, 20, of Ontario, Canada, ignited a larger pile, which exploded, the police report states. According to the report, firefighters heard the explosion from the nearby fire station.

The explosion left Burgess with small particles of burned material embedded in his arms, charges say.

Burgess was also charged in connection with that explosion and is facing one count of second-degree felony possession of an explosive device. As of Thursday, his case is pending.