Contraction and relaxation of the smooth muscle, including the corpus cavernosum, are mediated by changes in the intracellular concentration of calcium. Since magnesium modulates the movement of calcium, it can modify the function of the erectile tissue. We designed this study to investigate the effects of magnesium in doses ranging from 5 to 30 mM on the function of the rabbit corpus cavernosum in vitro. The resting tension of tissue strips was significantly reduced by exposure to a solution high in magnesium (5-30 mM). The contractile response to field stimulation under resting conditions, and the contraction to phenylephrine, were significantly decreased by magnesium (5-30 mM). There were no differences in the contractile strength of the corpus cavernosum to KCl. Although the relaxation induced by field stimulation under preincubation with 200 microM phenylephrine was abolished in the presence of 30 mM magnesium, there were no differences at a concentration of 5 mM or of 10 mM magnesium. The relaxation induced by sodium nitroprusside under precontraction with 200 microM phenylephrine was further increased by magnesium dose dependently. A high concentration of magnesium (30 mM) enhanced both bethanechol-induced and ATP-induced relaxations under precontraction with phenylephrine. Our study demonstrated that magnesium reduced the receptor-mediated contraction of the rabbit corpus cavernosum and enhanced the relaxation of this tissue induced by sodium nitroprusside, bethanechol, and ATP.