The Washington state man accused of planting a bomb along a Martin Luther King Jr. Day parade route earlier this year pleaded guilty Sept. 7 to federal hate crime and weapons charges.

According to the Associated Press, Kevin Harpham was sentenced to 27 to 32 years in prison after he reached a plea deal with federal prosecutors. The plea came just two days before he was scheduled to go on trial.

Harpham admitted to building a bomb and placing it along an MLK Day parade route in downtown Spokane, Wash. Jan. 17. Prosecutors said the pipe bomb was loaded with lead fishing weights coated with a chemical and could have caused numerous casualties if it had not been discovered and safely detonated. Three city workers discovered the explosive and notified the police about 30 minutes before the march was scheduled to begin.

The hate crime charge, which was used in the Eastern District of Washington for the first time, alleged that Harpham targeted the event “because of actual or perceived race, color and national origin of any person.”

In addition to the hate crime charge, Harpham was initially charged with attempt to use a weapon of mass destruction, using a firearm in retaliation to a crime of violence and unauthorized possession of an unregistered explosive device. The 37-year-old could have faced life in prison on the latter charges, which were dropped.

According to Reuters, investigators seized a camera in Harpham’s home and found deleted photos of him at the march.

Officials said that Harpham has ties to White supremacist organizations, but didn’t have a record of previous offences. But investigators did discover racist comments he made on the White supremacist website Vanguard News Network Forum.

Shortly after his arrest in March, officials also discovered that Harpham served in the U.S. Army in the 1990s and was stationed at a base near Tacoma, Wash. during his service.