  Large-scale magnetic fields are observed today to be coherent on galactic
scales. While there exists an explanation for their amplification and their
specific configuration in spiral galaxies -- the dynamo mechanism -- a
satisfying explanation for the original seed fields required is still lacking.
Cosmic strings are compelling candidates because of their scaling properties,
which would guarantee the coherence on cosmological scales of any resultant
magnetic fields at the time of galaxy formation. We present a mechanism for the
production of primordial seed magnetic fields from heterotic cosmic strings
arising from M theory. More specifically, we make use of heterotic cosmic
strings stemming from M5--branes wrapped around four of the compact internal
dimensions. These objects are stable on cosmological time scales and carry
charged zero modes. Therefore a scaling solution of such defects will generate
seed magnetic fields which are coherent on galactic scales today.
