We develop a quaternionic electrodynamics and show that it naturally supports the existence of magnetic monopoles. We obtained the field equations, the continuity equation, the electrodynamic force law, the Poynting vector, the energy conservation and the stress-energy tensor. The formalism also enabled us to generalize the Dirac monopole and the charge quantization rule.