SPOKANE, Wash. (AP) -- A man with extensive ties to white supremacists pleaded guilty Wednesday to charges he planted a bomb along a Martin Luther King Jr. Day parade route in Spokane, Wash., targeting minorities.

Kevin Harpham reached a deal with federal prosecutors for a recommended sentencing range of 27 to 32 years in prison just days before his trial was to begin in U.S. District Court.

The pipe bomb was loaded with lead fishing weights coated in a chemical, and could have caused mass casualties, prosecutors said.

The 37-year-old told U.S. District Court Judge Justin Quackenbush that it took him about a month to build the bomb with components he bought at Walmart and other places. He acknowledged placing the bomb along the parade route in an attempt to commit a hate crime.

The backpack bomb was discovered by parade workers and disabled before it could explode.

"This community was terrorized on Jan. 17 when this occurred," U.S. Attorney Mike Ormsby said after the hearing. "Hopefully the healing that needs to occur as a result of this happening can begin."

Ormsby said the evidence suggests that Harpham acted alone.

"There is no evidence to suggest anyone else was involved in this event," he said.

Ormsby praised the various law enforcement agencies that gathered evidence leading to Harpham's arrest on March 9. There was no particular tip that led officers to Harpham, Ormsby said. Rather, it was information about the purchase of components for the bomb and DNA on the backpack that housed it that led to the arrest, he said.

Harpham spoke in a clear voice when he said "guilty" to each of the two counts against him. When the judge asked if he placed the bomb along the parade route because of the actual or perceived race, color or national origin of the marchers, Harpham replied "yes."

He will be sentenced Nov. 30, and the judge has the option of imposing a sentence within the range of the agreement or not.

Harpham's public defender, Roger Peven, did not answer questions outside the courtroom.

Harpham originally was charged with committing a hate crime, using a firearm in relation to a crime of violence, attempt to use a weapon of mass destruction and unauthorized possession of an unregistered explosive device. He could have faced up to life in prison.

Harpham, of Addy, Wash., is an Army veteran who has extensive ties to white supremacist groups but no record of past crimes.

The Southern Poverty Law Center, which tracks hate groups, has said that Harpham made more than 1,000 postings on a racist website called the Vanguard News Network. The center also has said that Harpham belonged to a neo-Nazi group called the National Alliance.

Harpham served from 1996 to 1999 in the U.S. Army at what is now Joint Base Lewis-McChord, near Tacoma, Wash. His lawyers have said Harpham had not been recently employed.

He has remained in the Spokane County Jail without bail since his arrest.

Prosecutors recently revealed that Harpham took pictures of young black children gathering for the march and of a Jewish man who was wearing a yarmulke.

The hate crime charge, used for the first time in the Eastern District of Washington, contended Harpham targeted the parade in downtown Spokane "because of actual or perceived race, color and national origin of any person."