Consider a collapsing star with a magnetic field. It matters not whether the star is a neutron star, white dwarf, or whatever.
As the star collapses into a black hole, it runs into a theorem, "a black hole has no hair", in other words, there are no characteristics of a black hole other than mass, angular momentum, and electric charge. In particular, no magnetic field can penetrate the event horizon.
Hence, as the instant that the event horizon forms, the intense magnetic field of the star must be ejected violently from the body of the star. This magnetic field was generated by currents within the star. The field is suddenly cut loose from its source, but cannot simply cease to exist. It must follow Maxwell's Equations and explode at the speed of light. In doing so, it will run into the accretion disk surrounding the star. The intensity of the expanding field will accelerate the nuclei of the atoms to ultra-relativistic energies, producing both cosmic primaries as well as gamma rays.
As I said previously, some of these energetic nuclei will collide with "stationary" nuclei and ultra-relativistic neutrons (and other neutral baryons) will be produced. While the breaking effect of the cosmic microwave background radiation slows down the charged primaries, it has no effect on the uncharged neutrons. These neutrons travel all over the Universe in less than a second of proper time, so that they do not decay. When they strike the upper atmosphere of the Earth, they produce the high energy cosmic ray secondary showers that are reported.
The Origin of Ultra-High Energy Cosmic & Gamma Rays (originally from Mysteries of the Multiverse)
