  Magnetars have been suggested as the most promising site for the origin of
observed soft gamma-ray repeaters (SGRs) and anomalous X-ray pulsars (AXPs). In
this work we investigate the possibility that SGRs and AXPs might be
observational evidence for a magnetic phase separation in magnetars. We study
magnetic domain formation as a new mechanism for SGRs and AXPs in which
magnetar-matter separates into two phases containing different flux densities.
We identify the parameter space in matter density and magnetic field strength
at which there is an instability for magnetic domain formation. We conclude
that such instabilities will likely occur in the deep outer crust for the
magnetic Baym, Pethick, and Sutherland (BPS) model and in the inner crust and
core for magnetars described in relativistic Hartree theory. Moreover, we
estimate that the energy released by the onset of this instability is
comparable with the energy emitted by SGRs.
