Engineering durable nonspecific resistance to phytopathogens is one of the ultimate goals of plant breeding. However, most attempts to reach this goal fail as a result of rapid changes in pathogen populations and the sheer diversity of pathogen infection mechanisms. In this study, we show that the expression of a harpin-encoding gene (hrf1), derived from Xanthomonas oryzae pv. oryzae, confers nonspecific resistance in rice to the blast fungus Magnaporthe grisea. Transgenic plants and their T1-T7 progenies were highly resistant to all major M. grisea races in rice-growing areas along the Yangtze River, China. The expression of defence-related genes was activated in resistant transgenic plants, and the formation of melanized appressoria, which is essential for foliar infection, was inhibited on plant leaves. These results suggest that harpins may offer new opportunities for generating broad-spectrum disease resistance in other crops.