Enlarge / M82, the site of what's likely to be a giant flare from a magnetar. (credit: NASA, ESA and the Hubble Heritage Team)
Gamma rays are a broad category of high-energy photons, including everything with more energy than an X-ray. While they are often created by processes like radioactive decay, few astronomical events produce them in sufficient quantities that they can be detected when the radiation originates in another galaxy.
That said, the list is larger than one, which means detecting gamma rays doesn't mean we know what event produced them. At lower energies, they can be produced in the areas around black holes and by neutron stars. Supernovae can also produce a sudden burst of gamma rays, as can the merger of compact objects like neutron stars.
And then there are magnetars. These are neutron stars that, at least temporarily, have extreme magnetic fields—over 1012 times stronger than the Sun's magnetic field. Magnetars can experience flares and even giant flares where they send out copious amounts of energy, including gamma rays. These can be difficult to distinguish from gamma-ray bursts generated by the merger of compact objects, so the only confirmed magnetar giant bursts have happened in our own galaxy or its satellites. Until now, apparently.