We develop force field parameters for the divalent cations Mg2+, Ca2+, Sr2+, and Ba2+ for molecular dynamics simulations with the simple point charge- extended (SPC/E) water model. We follow an approach introduced recently for the optimization of monovalent ions, based on the simultaneous optimization of single ion and ion-pair properties.We consider the solvation free energy of the divalent cations as the relevant single-ion property. As a probe for ion- pair properties we compute the activity derivatives of the salt solutions. The optimization of the ionic force fields is done in two consecutive steps. First, the cation solvation free energy is determined as a function of the Lennard-Jones (LJ) parameters. The peak in the ion-water radial distribution function (RDF) is used as a check of the structural properties of the ions. Second, the activity derivatives of the electrolytes MgY2, CaY2 , BaY2, SrY2 are determined through Kirkwood-Buff solution theory, where Y = Cl−, Br−, I−. The activity derivatives are determined for the restricted set of LJ parameters which reproduce the exact solvation free energy of the divalent cations. The optimal ion parameters are those that match the experimental activity data and therefore simultaneously reproduce single-ion and ion-pair thermodynamic properties. For Ca2+, Ba2+, and Sr2+ such LJ parameters exist. On the other hand, for Mg2+ the experimental activity derivatives can only be reproduced if we generalize the combination rule for the anion-cation LJ interaction and rescale the effective cation-anion LJ radius, which is a modification that leaves the cation solvation free energy invariant. The divalent cation force fields are transferable within acceptable accuracy, meaning the same cation force field is valid for all halide ions Cl−, Br−, I− tested in this study.