Mg-ion batteries offer a safe, low-cost, and high-energy density alternative to current Li-ion batteries. However, nonaqueous Mg-ion batteries struggle with poor ionic conductivity, while aqueous batteries face a narrow electrochemical window. Our group previously developed a water-in-salt battery with an operating voltage above 2 V yet still lower than its nonaqueous counterpart because of the dominance of proton over Mg-ion insertion in the cathode. We designed a quasi-solid-state magnesium-ion battery (QSMB) that confines the hydrogen bond network for true multivalent metal ion storage. The QSMB demonstrates an energy density of 264 W·hour kg-1, nearly five times higher than aqueous Mg-ion batteries and a voltage plateau (2.6 to 2.0 V), outperforming other Mg-ion batteries. In addition, it retains 90% of its capacity after 900 cycles at subzero temperatures (-22°C). The QSMB leverages the advantages of aqueous and nonaqueous systems, offering an innovative approach to designing high-performing Mg-ion batteries and other multivalent metal ion batteries.