Yes. A giant magnetar flare is incredibly bright and emits as much radiation energy as the Sun does in hundreds of thousands of years.
How is it done? Even theorists aren’t sure. What scientists do know is that the energy comes from these stars’ intense magnetic fields, which are trillions of times stronger than the magnetic field on Earth’s surface — hence, astronomers call these objects “magnetars.”
One model predicts a surface disturbance, or star quake, on a neutron star shakes its intense magnetic fields. The shaking causes the magnetic-field lines to merge and release huge amounts of energy in the process. This process is similar to what happens during a flare on the Sun, but much more energetic. — Neil Gehrels, NASA Goddard Space Flight Center, Greenbelt, Maryland