Magnesium batteries have the potential to be a next generation battery with large capability and high safety, owing to the high abundance, great volumetric energy density, and reversible dendrite-free capability of Mg anodes. However, the lack of a stable high-voltage electrolyte, and the sluggish Mg-ion diffusion in lattices and through interfaces limit the practical uses of Mg batteries. Herein, a spinel MgIn2 S4 microflower-like material assembled by 2D-ultrathin (≈5.0 nm) nanosheets is reported and first used as a cathode material for high-temperature Mg batteries with an ionic liquid electrolyte. The nonflammable ionic liquid electrolyte ensure the safety under high temperatures. As prepared MgIn2 S4 exhibits wide-temperature-range adaptability (50-150 °C), ultrahigh capacity (≈500 mAh g-1 under 1.2 V vs Mg/Mg2+), fast Mg2+ diffusibility (≈2.0 × 10-8 cm2 s-1), and excellent cyclability (without capacity decay after 450 cycles). These excellent electrochemical properties are due to the fast kinetics of magnesium by the 2D nanosheets spinel structure and safe high-temperature operation environment. From ex situ X-ray diffraction and transmission electron microscopy measurements, a conversion reaction of the Mg2+ storage mechanism is found. The excellent performance and superior security make it promising in high-temperature batteries for practical applications.