We use a low-temperature scanning tunneling microscope (STM) to perform electron spin resonance (ESR) of individual magnetic atoms on a surface, and employ these atoms as atomic-scale magnetic sensors1. This technique combines the single-atom control of STM with the high energy resolution of ESR. We drive spin resonance by using the large electric field available in the tunnel junction1,2, and sense the spin by means of magnetoresistance, using a spin-polarized STM tip. Magnetic coupling between two iron atoms placed a few nanometers apart on an MgO film shows inverse-cube distance dependence, indicating magnetic dipolar interaction3. This yields a precise measure of the magnetic moment of the iron atom, which is then used to probe other atoms, such as the bistable magnetic bits formed by individual holmium atoms4. We also use STM to drive ESR of titanium5 and copper atoms6, which show free spin-1/2 behavior, in contrast to the high spin and large magnetic anisotropy of iron. Assembled arrays of low-spin atoms show exchange coupling that results in highly entangled magnetic states for quantum simulation of many-body states5. ESR also reveals hyperfine coupling between the nucleus and the electrons of each atom6,7. Furthermore, pulsed ESR allows us to perform coherent manipulation of atomic spins in order to observe Rabi oscillation, Ramsey fringes, and spin echoes8. The combination of STM with ESR thus provides a versatile tool for exploring nano-scale quantum magnetism. 1. Baumann et al., Science 350, 417 (2015). 2. Lado et al., Phys. Rev. B 96, 205420 (2017). 3. Choi et al., Nat. Nanotechnol. 12, 420 (2017). 4. Natterer et al., Nature 543, 226 (2017). 5. Yang et al., Phys. Rev. Lett. 119, 227206 (2017). 6. Yang et al., Nat. Nanotechnol. 13, 1120 (2018). 7. Willke et al., Science 362, 336 (2018). 8. Yang et al., Science 366, 509 (2019). *We acknowledge funding from the Office of Naval Research.