Although allelic diversity of genes has been reported to play important roles in different physiological processes, information on allelic diversity of defense-responsive genes in host-pathogen interactions is limited. Here, we report that a pair of allelic genes, OsWRKY45-1 and OsWRKY45-2, which encode proteins with a 10-amino acid difference, play opposite roles in rice (Oryza sativa) resistance against bacterial pathogens. Bacterial blight caused by Xanthomonas oryzae pv oryzae (Xoo), bacterial streak caused by Xanthomonas oryzae pv oryzicola (Xoc), and fungal blast caused by Magnaporthe grisea are devastating diseases of rice worldwide. OsWRKY45-1-overexpressing plants showed increased susceptibility and OsWRKY45-1-knockout plants showed enhanced resistance to Xoo and Xoc. In contrast, OsWRKY45-2-overexpressing plants showed enhanced resistance and OsWRKY45-2-suppressing plants showed increased susceptibility to Xoo and Xoc. Interestingly, both OsWRKY45-1- and OsWRKY45-2-overexpressing plants showed enhanced resistance to M. grisea. OsWRKY45-1-regulated Xoo resistance was accompanied by increased accumulation of salicylic acid and jasmonic acid and induced expression of a subset of defense-responsive genes, while OsWRKY45-2-regulated Xoo resistance was accompanied by increased accumulation of jasmonic acid but not salicylic acid and induced expression of another subset of defense-responsive genes. These results suggest that both OsWRKY45-1 and OsWRKY45-2 are positive regulators in rice resistance against M. grisea, but the former is a negative regulator and the latter is a positive regulator in rice resistance against Xoo and Xoc. The opposite roles of the two allelic genes in rice-Xoo interaction appear to be due to their mediation of different defense signaling pathways.