The spinel LiMgxMn2-xO4–2xF2x (x=0, 0.05, 0.1, 0.2) samples are synthesized via a solid-state reaction route with the MgF2 as the dopant. The structure and performance of the samples are characterized by powder X-ray diffraction, atomic absorption spectroscopy, X-ray photoelectron spectroscopy, scanning electron microscopy, galvanostatic charge-discharge and electrochemical impedance spectroscopy. The results reveal that the LiMgxMn2-xO4–2xF2x (x= 0, 0.05, 0.1, 0.2) samples possess the typical octahedral structure with single phase. Especially, LiMg0.1Mn1.9O3.8F0.2 shows the highest initial discharge capacity of 121.1 mAh g−1, and the capacity retention is still as high as 89.2% even after 400 cycles at a rate of 1C under an elevated temperature of 55°C. Besides, it presents an excellent rate capability, a high discharge capacity of over 76.1 mAh g−1 is still obtained even at the high rate of 20C. Furthermore, it has been confirmed that the Mg and F co-substitution can fundamentally ameliorate the Jahn-teller distortion of the conventional LiMn2O4, thus this is a very effective way for improving the elevated temperature capacity retention of LiMn2O4.