The birth of a neutron star with an extremely strong magnetic field, called a magnetar, has emerged as a promising scenario to power a variety of outstanding explosive events. This includes gamma-ray bursts, supernovae with extreme kinetic energies called hypernovae and super-luminous supernovae. The origin of these extreme magnetic fields (of the order of 10^15 Gauss) remains, however, obscure and requires an amplification over several orders of magnitude during the formation of the neutron star.