  We propose a novel mechanism for significantly enhancing the amplitude of
primordial electromagnetic fields during inflation. Similar to existing
proposals, our idea is based on parametric resonance effects due to
conformal-symmetry-breaking coupling of a gauge field and the inflaton. Our
proposed scenario, however, significantly differs from previously studied
models, and avoids their shortcomings. We, particularly, construct a viable
system where the gauge field is exponentially amplified on super-horizon
scales, therefore evading the no-go theorem formulated on the basis of widely
encountered drastic back-reaction of the magnetic field energy on the
inflationary background. We argue that in order for the resonant scenario to
work with a bounded and positive-definite coupling function, a mass term for
the gauge sector is required. We compute the spectrum of the produced magnetic
fields and demonstrate the compatibility with current observational
constraints. We demonstrate that while the magnetic fields do not noticeably
back-react on the inflationary background, the non-zero mass term can
contribute significantly to the total energy-momentum tensor. We point out the
parameter space where the latter issue is absent.
