The localized-orbital/local-origin (LORG) method and the second-order polarization propagator approximation (SOPPA) are combined to form a local gauge theory of nuclear magnetic shielding that includes electron-correlation effects through second order in the fluctuation potential. Calculations are presented for the NMR shielding tensors of a set of molecules spanning the range of 31P shieldings. The results show that correlation effects on the shieldings can be significant, and that the use of local gauge origins yields marked improvement over common-origin calculations.