The structural and dynamical properties of the alkaline earth metal ions Mg2+, Ca2+, and Sr2+ and their carbonate and bicarbonate complexes in aqueous solution are examined through first principles molecular dynamics simulations based on the density functional theory. Calculations were conducted in explicit heavy water molecules and at the average temperature 400 K, conditions which are necessary to obtain a liquid-like water structure and diffusion time-scales when using gradient corrected density functionals. According to these simulations, the magnesium ion undergoes a significant contraction of its coordination sphere in the Mg(H)CO3(+) aqueous complex, whereas calcium and strontium increase their average first shell coordination number when coordinated to HCO3- or CO32-. The analysis of the water exchange processes in the hydration shells of the metals suggests the following order for metal reactivity in solution: Mg2+ < Ca2+ < So(2+). Moreover, our simulations suggest that the structures of the most stable monomers of magnesium bicarbonate and magnesium carbonate in solution is Mg[(I)-(H)CO3](H2O)(4)((+)); that is, the preferred hydration number is four and the (hi-)carbonate is coordinated to the magnesium in a monodentate mode, whereas the building blocks of CaCO3 in aqueous solutions of calcium bicarbonate and calcium carbonate are Ca[eta(1)-(H)CO3](H2O)((+)). It is not possible, however, to define a unique building unit for strontium (hi-)carbonate clue to the rapid inter-conversion between the mono- and hi-coordination mode of HCO3-, and the spontaneous dissociation of SrCO3 during the simulation period. Molecular dynamics simulations of ion pairs Me2+-X- (Me = Mg., Ca, and Sr; X = F, Cl, and Br) in water have also been conducted, and the results indicate changes of the structural and dynamical properties of the first and second hydration shell of Mg2+ and Ca3+, which are explained in terms of modification by the halide ions of the neighboring water molecules, and consequent "reconstruction" of the first hydration shell of the calcium and magnesium ions.