A magnesium battery, having an anode containing magnesium; a cathode stable to a voltage of at least 2.6 V relative to a magnesium reference; and an electrolyte containing an electrochemically active magnesium salt obtained by reaction of a Grignard reagent or Hauser base with a boron compound of formula BR3 is provided. The electrolyte is stable to 2.6 E.V. vs. Mg in the presence of stainless steel.