The selectivity filter of K(+) channels contains four ion binding sites (S1-S4) and serves dual functions of discriminating K(+) from Na(+) and acting as a gate during C-type inactivation. C-type inactivation is modulated by ion binding to the selectivity filter sites, but the underlying mechanism is not known. Here we evaluate how the ion binding sites in the selectivity filter of the KcsA channel participate in C-type inactivation and in recovery from inactivation. We use unnatural amide-to-ester substitutions in the protein backbone to manipulate the S1-S3 sites and a side-chain substitution to perturb the S4 site. We develop an improved semisynthetic approach for generating these amide-to-ester substitutions in the selectivity filter. Our combined electrophysiological and X-ray crystallographic analysis of the selectivity filter mutants show that the ion binding sites play specific roles during inactivation and provide insights into the structural changes at the selectivity filter during C-type inactivation.