The theory of mean-field galactic dynamos is generalized by allowing for a finite response time of the mean electromotive force (emf) to variations in the mean magnetic field and small-scale turbulence. A non-axisymmetric forcing of the dynamo by a spiral pattern (either stationary or transient) is invoked. The resulting magnetic spiral arms are phase-shifted from the spiral arms of the pattern by an angle 15°–40°, opposite to the sense of galactic rotation. Our findings may help to explain the phase shift between material and magnetic arms observed in NGC 6946 and other galaxies.