Glass ionomer cements (GIC) are used in restorative dentistry and their properties (low heat during setting, adhesion to mineralised tissue and surgical metals) make them of great interest for bone applications.However, dental GIC are based on aluminium-containing glasses, and the resulting release of aluminium ions from the cements needs to be avoided for applications as bone cements. Replacing aluminium ions in glasses for use in glass ionomer cements is challenging, as aluminium ions play a critical role in the required glass degradation by acid attack as well as in GIC mechanical stability. Magnesium ions have been used as an alternative for aluminium in the glass component, but so far no systematic study has looked into the actual role of magnesium ions. The aim of the present study is therefore the systematic comparison of the effect of magnesium ions compared to calcium ions in GIC glasses. It is shown that by partially substituting MgO for CaO in simple SiO2-CaO-CaF2 glasses, ion release from the glass and, subsequently, GIC setting behaviour can be adjusted. Magnesium ions act as typical network modifiers here but owing to their larger field strength compared to calcium ions reduce ion release from the glasses significantly. By choosing an optimum ratio of magnesium and calcium ions in the glass, GIC setting and subsequently compressive strength can be controlled.