Cylindrical cell model Poisson-Boltzmann (P-B) calculations are used to evaluate the electrostatic contributions to the relative stability of various DNA conformations (A, B, C, Z, and single-stranded (ss) with charge spacings of 3.38 and 4.2 A) as a function of interhelix distance in a concentrated solution of divalent cations. The divalent ion concentration was set at 100 mM, to compare with our earlier reports of spectroscopic and calorimetric experiments, which demonstrate substantial disruption of B-DNA geometry. Monovalent cations neutralize the DNA phosphates in two ways, corresponding to different experimental situations: 1) There is no significant contribution to the ionic strength from the neutralizing cations, corresponding to DNA condensation from dilute solution and to osmotic stress experiments in which DNA segments are brought into close proximity to each other in the presence of a large excess of buffer. 2) The solution is uniformly concentrated in DNA, so that the neutralizing cations add significantly to those in the buffer at close DNA packing. In case 1), conformations with lower charge density (Z and ssDNA) have markedly lower electrostatic free energies than B-DNA as the DNA molecules approach closely, due largely to ionic entropy. If the divalent cations bind preferentially to single-stranded DNA or a distorted form of B-DNA, as is the case with transition metals, the base pairing and stacking free energies that stabilize the double helix against electrostatic denaturation may be overcome. Strong binding to the bases is favored by the high concentration of divalent cations at the DNA surface arising from the large negative surface potential; the surface concentration increases sharply as the interhelical distance decreases. In case 2), the concentration of neutralizing monovalent cations becomes very large and the electrostatic free energy difference between secondary structures becomes small as the interhelical spacing decreases. Such high ionic concentrations will be expected to modify the stability of DNA by changing water activity as well as by screening electrostatic interactions. This may be the root of the decreased thermal stability of DNA in the presence of high concentrations of magnesium ions.