Diamagnetic and paramagnetic phases in low-energy quantum chromodynamics