TAL effectors of plant pathogenic bacteria in the genus Xanthomonas bind host DNA and activate genes that contribute to disease or turn on defense. Target specificity depends on an effector-variable number of typically 34 amino acid repeats, but the mechanism of recognition is not understood. We show that a repeat-variable pair of residues specifies the nucleotides in the target site, one pair to one nucleotide, with no apparent context dependence. Our finding represents a previously unknown mechanism for protein-DNA recognition that explains TAL effector specificity, enables target site prediction, and opens prospects for use of TAL effectors in research and biotechnology.