PTH and Hypocalcemia: Magnesium is needed for the secretion of PTH by the parathyroid glands and its depletion or excess may cause hypoparathyroidism and subsequent hypocalcemia.