Spinel Li4Ti5O12 co-doped with Mg2+ and F− was synthesized by solid-state reaction of anatase TiO2, Li2CO3, NH4F, and Mg(NO3)2. For comparison, Mg2+-doped and F−-doped Li4Ti5O12 were prepared using the same method. The structure and electrochemical performance of the prepared materials were investigated by X-ray diffraction, scanning electron microscopy, energy dispersive X-ray spectroscopy, high-resolution transmission electron microscopy, electrochemical impedance spectroscopy, and galvanostatic charge-discharge tests. Using an internal standard and Rietveld refinement, we calculated the lattice parameters of the samples. After co-doping with Mg2+ and F−, the dopant ions enter the Li4Ti5O12 lattice, resulting in the reduction of Ti4+ to Ti3+, and increasing the conductivity of the material. Furthermore, the Mg2+ and F− co-doping technique resulted in smaller primary particles with a narrow size distribution, factors that can accelerate transfer of Li+ between the electrode and electrolyte. Consequently, the Mg2+ and F− co-doped Li4Ti5O12 material exhibits a superior rate performance and delivers discharge capacities of 159.4, 154.1, 146.5, 120.8, 102.7, and 76mAhg−1 at 0.2C, 0.5C, 1C, 3C, 5C, and 10C, respectively, significantly higher than those of pure Li4Ti5O12 (155.4, 138.6, 124.2, 94.1, 76.7, and 52.2mAhg−1 at the same C-rates). Moreover, the Mg2+ and F− co-doped Li4Ti5O12 showed outstanding cycling stability, and the capacity retention was 99.62% after 150 cycles at 5C rate. Therefore, the Mg2+ and F− co-doping technique has proven an effective approach to improve the electrochemical performance of Li4Ti5O12.