Electrochemical deposition of magnesium (Mg) has been successfully achieved from an ionic liquid (IL) solution based on quaternary ammonium salt containing lithium (Li) salt. Irreversible electrochemical behavior was generally observed in the IL-based electrolytes containing simple Mg salt. In the IL-based electrolyte dissolving both Mg and Li salts, electrochemical reduction and oxidation of magnesium cation (Mg2+) have become detectable. Such reversible processes correspond respectively to cathodic deposition and anodic dissolution of metallic Mg, which are accompanied by the co-deposition/co-dissolution of Li. Potentiostatic electrolysis of IL dissolving binary Mg and Li salts gave metallic deposit consisting of both elements with total current efficiency of ca. 52%.