Spinel LiNi0.5Mn1.5O4 (LNMO) is a promising cathode candidate for the next-generation high energy-density lithium-ion batteries (LIBs). Unfortunately, the application of LNMO is hindered by its poor cycle stability. Now, site-selectively doped LNMO electrode is prepared with exceptional durability. In this work, Mg is selectively doped onto both tetrahedral (8a) and octahedral (16c) sites in the Fd (Formula presented.) m structure. This site-selective doping not only suppresses unfavorable two-phase reactions and stabilizes the LNMO structure against structural deformation, but also mitigates the dissolution of Mn during cycling. Mg-doped LNMOs exhibit extraordinarily stable electrochemical performance in both half-cells and prototype full-batteries with novel TiNb2O7 counter-electrodes. This work pioneers an atomic-doping engineering strategy for electrode materials that could be extended to other energy materials to create high-performance devices.