DENVER | A former hippie who left a homemade bomb outside the police station of Nederland was sentenced to 27 years in prison on Friday after a judge found it was an act of terrorism intended to avenge the killing of a friend by the town marshal in 1971. The bomb never detonated.

David Ansberry pleaded guilty to leaving the device containing the unstable chemical compound HMDT, a peroxide-based compound that has been used by al Qaida terrorists, in a duffel bag outside the station in a strip mall in Nederland on Oct. 11, 2016. U.S. District Judge Christine Arguello said the device was not a hoax and people could have died had Ansberry been successful in his attempts to set the bomb off remotely using a cellphone.

“It was fortuitous that that bomb did not go off,” said Arguello, who said that apparently the compound had degraded, losing potency.

The sentence was the minimum that the 67-year-old could receive after Arguello sided with the government in treating the crime as terrorism, which dramatically increased the sentencing range. Ansberry’s lawyers had argued that he should only face up to over 2 years in prison, about the time he has already served since his arrest. Defense lawyer Abraham Hutt said the bomb did not even damage the cement after the bomb squad fired a high energy slug into it.

Government experts earlier testified that the blast tore apart sand bags set up to send energy waves from the explosion upward and shattered the glass jar containing the HMDT, but it failed to ignite a bag full of crushed hexamine camping fuel tablets attached by another wire to the device.

The Associated Press is an independent, not-for-profit news cooperative of 1,300 newspapers, including The Sentinel, headquartered in New York City. News teams in over 100 countries tell the world’s...