The force that holds atoms and molecules together through the attraction of unlike charges and repulsion of like charges. Its range is infinite and it obeys the inverse square law. At the atomic and subatomic level the electromagnetic force is an exchange force arising from the exchange of virtual photons according to the theory of quantum electrodynamics (QED). It is one of the four fundamental forces of nature.