The valence selectivity of the gramicidin channel is examined using computer simulations based on atomic models. The channel interior is modeled using a gramicidin-like periodic poly (L,D)-alanine beta-helix. Free energy perturbation calculations are performed to obtain the relative affinity of K+ and Cl- for the channel. It is observed that the interior of the gramicidin channel provides an energetically favorable interaction site for a cation but not for an anion. Relative to solvation in bulk water, the carbonyl CO oxygens can provide a favorable interaction to stabilize K+, whereas the amide NH hydrogens are much less effective in stabilizing Cl-. The results of the calculations demonstrate that, as a consequence of the structural asymmetry of the backbone charge distribution, a K+ cation can partition spontaneously from bulk water to the interior of the gramicidin channel, whereas a Cl- anion cannot.