An Oregon man accused of making a homemade bomb filled with dog feces is facing criminal charges after investigators said a former friend accidentally set it off and got an unwelcome surprise.

Robb Alexander Stout, 48, allegedly rigged a poop-filled toolbox to explode when opened, because he was angry at the ex-friend for not returning something of his, according to a probable cause affidavit.

To make the contraption, he was said to have explored a courtyard area near his house, collecting feces from his dog and other dogs in the area, the Oregonian reported.

3 STUDENTS ACCUSED OF PLOTTING TO BOMB LONG ISLAND SCHOOL USING 'THE ANARCHIST COOKBOOK'

His ex-friend called police on April 16 after the incident to report that someone had left the toolbox on the back of his Camaro. He suspected Stout, and after opening it, described how the device "exploded with such force that it sounded like an M80 going off and the dog scat was blown out of the toolbox," according to the court documents.

It appeared the man wasn't hurt; Stout wasn't charged with assault and court papers didn't describe any injuries, according to the Oregonian.

After an investigation, police determined the toolbox was rigged with a battery, wiring, switches and a car's air bag.

Stout told police the inspiration for this stinky act was a series of prank videos on YouTube the pair used to watch together.

CLICK HERE TO GET THE FOX NEWS APP

He was booked in jail Thursday and released the same day after posting $2,000 bond.

The next day, Stout was arraigned in Multnomah County Circuit Court in Portland on a felony charge of unlawfully manufacturing a destructive device. The Oregonian reported that police found methamphetamine and a sawed-off shotgun in his home, leading to charges of meth possession, being a felon in possession of a firearm and unlawfully possessing a short-barrel shotgun.