A judge sentenced a former hippie to 27 years in prison on Friday for a 2016 incident where he left a homemade bomb outside a Nederland, Colorado, police station.

The judge ruled Friday that David Ansberry, 67, committed an act of terrorism even though his device did not not detonate.

Ansberry pleaded guilty to leaving a bomb containing HMDT, an unstable chemical compound which has been the chemical of choice some for al Qaeda terrorists, outside a Nederland police station in a strip mall in October 2016.

U.S. District Judge Christine Arguello ruled at Ansberry’s hearing that the failed bombing attempt was an act of retaliation for the 1971 murder of his friend, Guy Goughner, after the town’s marshal fatally shot him in the head.

“It was fortuitous that that bomb did not go off,” said Arguello, adding that the compound in the bomb appeared to be diluted enough to keep it from detonating.

The 67-year-old, who had ties to a violent radical hippie group known as the STP Family, claimed that he did not try to detonate the bomb and that he was merely trying to raise awareness about police shootings.