Magnesium ions (Mg2+) in cellular biology are usually in almost all sences opposite to Ca2+ ions, because they are bivalent too, but have larger atomic radius. Thus Mg2+ ions are blocking Ca channels (NMDA channels) for example, etc.