NOVELTY - Primary (non-rechargeable) and secondary (rechargeable) batteries contain at least one anode containing magnesium, at least one cathode, an electrolytic set between the anode and the cathode, and current electrodes. Optionally also the cathode and the electrolyte contain magnesium.    USE - As non-rechargeable and rechargeable batteries (claimed) in the presence of new portable digital electronic devices e.g. computers, cellophones, videocameras.    ADVANTAGE - The batteries overcome the problems of reactivity and reversibility typical of lithium-based batteries. It also allows a reduction in production costs. The batteries are suitable in portable digital electronic equipment. Thus the technical performance is superior as compared to the prior art batteries. The batteries also have better workability together with a good reactivity and oxide-reducing voltage. It also provides total absence of environmental impacts, given that the components materials are all non-polluting.    DETAILED DESCRIPTION - INDEPENDENT CLAIMS are included for the following: (A) use of delta magnesium chloride or Grignard magnesium as ionic species of magnesium for the electrolyte; (B) production of batteries involving preparing the anode containing magnesium in various states of oxidation (Mgn+) optionally combined with metallic Mg.    n = 0 - 2.    The anode has a base of metallic magnesium or other magnesium on a substrate of highly conductive inorganic or organic materials or in inorganic or organic materials for intercalation or embedding of the magnesium, optionally preparing the cathode containing species of magnesium in the state of oxidation 2+ having the substrate of highly conductive inorganic or organic materials or in inorganic or organic materials for intercalation or embedding of the magnesium, and/or preparing the electrolyte containing an ionic species of magnesium in solvents that are capable of producing electrolytes having good ionic conductivity and of solvating the species; and (C) a method for setting magnesium batteries containing the anode, the cathode, the electrolyte and the current collectors and optionally dielectric spacer in contact between one another involving setting the electrolyte between the anode and the cathode between room temperature and approximately 150degreesC.