Calcium (Ca(2+)) and magnesium (Mg(2+)) ions are involved in many vital physiological functions. Since dietary intake is the only source of minerals for the body, intestinal absorption is essential for normal homeostatic levels. The aim of this study was to characterize the absorption of Ca(2+) as well as Mg(2+) along the gastrointestinal tract at a molecular and functional level. In both humans and mice the Ca(2+) channel transient receptor potential vanilloid subtype 6 (TRPV6) is expressed in the proximal intestinal segments, whereas Mg(2+) channel transient receptor potential melastatin subtype 6 (TRPM6) is expressed in the distal parts of the intestine. A method was established to measure the rate of Mg(2+) absorption from the intestine in a time-dependent manner by use of (25)Mg(2+). In addition, local absorption of Ca(2+) and Mg(2+) in different segments of the intestine of mice was determined by using surgically implanted intestinal cannulas. By these methods, it was demonstrated that intestinal absorption of Mg(2+) is regulated by dietary needs in a vitamin D-independent manner. Also, it was shown that at low luminal concentrations, favoring transcellular absorption, Ca(2+) transport mainly takes place in the proximal segments of the intestine, whereas Mg(2+) absorption predominantly occurs in the distal part of the gastrointestinal tract. Vitamin D treatment of mice increased serum Mg(2+) levels and 24-h urinary Mg(2+) excretion, but not intestinal absorption of (25)Mg(2+). Segmental cannulation of the intestine and time-dependent absorption studies using (25)Mg(2+) provide new ways to study intestinal Mg(2+) absorption.