An Oregon man who targeted his former friend with an improvised dog poop-filled bomb avoided prison Tuesday when he was sentenced to three years probation.

Robb Alexander Stout, 49, admitted to filling a plastic toolbox with dog feces and timing it to explode when the victim opened it, The Oregonian reported.

Stout pleaded guilty to unlawful manufacture of a destructive device and to being a felon in possession of a firearm and delivery of methamphetamine.

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

The device was put on the back of a Camaro owned by Stout's former friend on April 16. When it exploded, it sounded “like an M80 going off and the dog scat was blown out of the toolbox,” investigators said.

The friend wasn't hurt. Stout said he and the victim used to make similar explosives together and he didn't think making the device was a crime.

The pair had a falling out when Stout believed the friend had no intention of giving back some tools he borrowed.

“I guess the right way would have been to get a police officer involved,” he said. “It was just made to hurt his ego and give me my stuff back, like a wake-up call.”

The paper reported the victim left Tuesday's court proceedings early and still feared for his safety.

CLICK HERE TO GET THE FOX NEWS APP

Stout had 14 previous convictions for drugs and eluding police, the paper reported. As part of his probation, the court ordered him to complete drug treatment, stay away from the victim and avoid making explosive devices or fireworks.

Prosecutors took into consideration Stout's lack of convictions for violent acts and his behavior since he was released from jail several months ago.