First-principles calculations are performed for hydroxyapatite ͑Hap͒ in order to investigate the relative ion exchange ability with divalent cations such as Mg 2+ , Ni 2+ , Cu 2+ , Zn 2+ , Sr 2+ , Cd 2+ , Ba 2+ , and Pb 2+. Their ionic substitutional energies are calculated from total energies of supercells and chemical potentials for Ca 2+ and the foreign cations determined under chemical equilibrium between HAp and its saturated solution. It is found that, in most cases, the ion exchange ability is basically dependent on the ionic sizes and the larger or smaller-sized cations than Ca 2+ tend to exhibit more difficulty of substitution for Ca 2+ in HAp. However, Pb 2+ exhibits the extremely small substitutional energy, which originates from covalent bonds with the adjacent oxygen atoms. In particular, Pb 2+ at the Ca-1 site of HAp has covalency with the second-nearest-neighboring oxygen atoms as well as the first nearest-neighboring ones. The covalent bond formation plays an important role for the distinct ion exchange ability for Pb 2+ by HAp observed experimentally.