Abstract Simulated physiological solutions mimicking human plasma have been utilized to study the in vitro corrosion of biodegradable metals. However, corrosion and corrosion product formation are different for different solutions with varied responses and, hence, the prediction of in vivo degradation behavior is not feasible based on these studies alone. This paper reports the role of physiologically relevant salts and their concentrations on the corrosion behavior of a magnesium alloy (AZ31B) and subsequent corrosion production formation. Immersion tests were performed for three different concentrations of Ca2+, HPO42-, HCO3- to identify the effect of each ion on the corrosion of AZ31B assessed at 1, 3 and 10days. Time-lapse morphological characterization of the samples was performed using X-ray computed tomography and scanning electron microscopy. The chemical composition of the surface corrosion products was determined by electron dispersive X-ray spectroscopy and X-ray diffraction. The results show that: (1) calcium is not present in the corrosion product layer when only Cl− and OH− anions are available; (2) the presence of phosphate induces formation of a densely packed amorphous magnesium phosphate corrosion product layer when HPO42- and Cl− are present in solution; (3) octacalcium phosphate and hydroxyapatite (HAp) are deposited on the surface of the magnesium alloy when HPO42- and Ca2+ are present together in NaCl solution (this coating limits localized corrosion and increases general corrosion resistance); (4) addition of HCO3- accelerates the overall corrosion rate, which increases with increasing bicarbonate concentration; (5) the corrosion rate decreases due to the formation of insoluble HAp on the surface when HCO3-, Ca2+, and HPO42- are present together.