The sarcoplasmic reticulum (SR) Ca(2+)-ATPase, a P-type transmembrane protein, can transport Ca(2+) from the cytoplasmic to the luminal side over other cations specifically. The proposed Ca(2+) entrance channel, composed of the main-chain carbonyl oxygen and side-chain carboxyl oxygen atoms of the amino acids, opens on the enzyme surface, just above the biphospholipid layer membrane-water interface, where Trp residues are frequently found. In this work, the physicochemical nature of Ca(2+) selectivity over Mg(2+) on the surface of the SR Ca(2+)-ATPase has been investigated using the density functional theory (DFT) method. The selection process can be regarded as the first step of the specificity of the enzyme to transport Ca(2+). Subsequently, the specificity of the entrance channel to conduct Ca(2+) over other cations has also been explored. As revealed by thermodynamic analyses, either the aromatic or the aliphatic amino acid residues distributed on the surface of Ca(2+)-ATPase have a bigger affinity to Mg(2+) than to Ca(2+), resulting in a concentration decrease of free Mg(2+) in the local region. Thus, Ca(2+) can transport into the Ca(2+)-entrance channel more easily. Whereafter, for a small quantity of Mg(2+) entering this channel accompanying the Ca(2+) current, the strong electrostatic interactions between Mg(2+) and the ligands will limit the activity of this metal ion, which facilitates the weakly bonded Ca(2+) passing through the channel at a relatively high rate, as suggested by the "sticky-pore" hypothesis. Furthermore, the corresponding theoretical investigations have demonstrated that the increase of the ligand electronegativity can enhance their discrimination between these two cations effectively.