The first-principles calculation method used in this study has an extended Hamiltonian, which contains both spin states, so that the spin magnetic moment per unit cell, m, and magnetization vector, M, can be obtained via the spinors of atomic orbitals. Both spin- and orbital-B-field couplings are considered. The magnetic field, B, induces not only components of m and M along their directions, which vanish when the field is cut off, but also bi-stable spontaneous z components, mz and Mz. This study reveals that the spin-B-field coupling is energetically too weak to reverse mz/Mz directly. The B field is found to reverse the spin polarization of itinerant sp electrons first when B reaches a threshold, which then triggers the reversal of mz/Mz via nonlocal exchange interactions with localized d electrons. The hysteresis effect is found to be due to the existence of bi-stable mz/Mz and that without a reversed B the spin-polarization of itinerant sp electrons will not be reversed to trigger magnetic switching.