Studies in isolated cardiac myocytes have increased our understanding of intracellular Ca2+ regulation. Because less is known about Mg2+ regulation, adult rat ventricular myocytes were loaded with the Mg(2+)-sensitive fluorescent probe mag-indo 1, and changes in intracellular Mg2+ concentration ([Mg2+]i) and cell length were examined under a variety of conditions. The fluorescent signal was calibrated intracellularly and found to differ slightly from that for the probe in solution. Roughly 40% of the signal was intramitochondrial; the remainder was localized in the cytosol. Basal [Mg2+]i averaged 1.02 +/- 0.03 mM (n = 53 cells). No change in [Mg2+]i was observed during a single electrically stimulated contraction, and only a minor increase was seen during rapid electrical stimulation, which was expected to raise intracellular Ca2+ concentration ([Ca2+]i) to approximately 1 microM. An acid shift in intracellular pH of approximately 1 pH unit was accompanied by a small change in [Mg2+]i (0.34 +/- 0.03 mM, n = 6, P < 0.05). No change in [Mg2+]i was observed when cells were superfused with 15 mM Mg2+, despite marked changes in contraction. [Mg2+]i more than doubled when cells were depleted of ATP by exposure to hypoxia or metabolic inhibitors. The increase in [Mg2+]i was abrupt and occurred at the time of the failure of contraction, plateauing as rigor contracture developed. Reoxygenation was accompanied by a gradual fall in [Mg2+]i in cells that recovered mechanical function, and in a subset of cells that underwent hypercontracture. Studies in cell suspensions confirmed that rapid cellular energy depletion was accompanied by increases in [Mg2+]i and parallel decreases in ATP. Thus [Mg2+]i was largely insensitive to changes in [Ca2+]i or pHi and extracellular [Mg2+] but was rapidly altered by changes in energy state in a manner that was related to specific changes in cell morphology and contractile function.