Mg-doped Li[Li0.2–2xMgxCo0.13Ni0.13Mn0.54]O2 is synthesized by introducing Mg ions into the transition-metal (TM) layer of this layered compound for substituting Li ions through a simple polymer-pyrolysis method. The structural and morphological characterization reveals that the doped Mg ions are uniformly distributed in the bulk lattice, showing an insignificant impact on the layered structure. Electrochemical experiments reveal that, at a Mg doping of 4%, the Li[Li0.16Mg0.04Co0.13Ni0.13Mn0.54]O2 electrode can deliver a larger initial reversible capacity of 272 mAh g–1, an improved rate capability with 114 mAh g–1 at 8 C, and an excellent cycling stability with 93.3% capacity retention after 300 cycles. The superior electrochemical performances of the Mg-doped material are possibly due to the enhancement of the structural stability by substitution of Li by Mg in the TM layer, which effectively suppresses the cation mixing arrangement, leading to the alleviation of the phase change during lithium-ion insertion and extraction.