A man faces felony charges after he allegedly detonated a pipe bomb Tuesday afternoon in a field behind the north Medford Fred Meyer store.

Justin William Keaton, 45, described by Medford police as a transient, is accused of making a metal pipe bomb filled with gravel and gunpowder and setting it off. Keaton was arrested within minutes of the explosion.

A witness called dispatchers after spotting Keaton packing gunpowder into a metal pipe in the rear parking lot at the Fred Meyer store on Crater Lake Highway, according to a court document filed by Medford police. Dispatchers promptly alerted the store manager, who witnessed Keaton lighting the explosive and fleeing on a bicycle, leaving behind a canister of gunpowder.

The loud explosion was reported at 12:44 p.m. Tuesday. Keaton was in custody by 12:49 p.m., according to police. The pipe bomb was longer than a foot.

Officers arrested Keaton a few blocks away from the store in the Ramada Inn parking lot. A search of his backpack yielded several feet of fuse and two more canisters of gunpowder. Medford police consulted with the Oregon State Police Bomb Squad during the investigation.

Keaton faces felony counts of manufacturing a destructive device and possessing a destructive device, and was scheduled to be arraigned Wednesday on the charges in Jackson County Circuit Court. Keaton remained lodged in Jackson County Jail without bail for violating his probation on a prior meth-possession conviction.