Xanthomonas oryzae pv. oryzae (Xoo) causes bacterial blight (BB), a globally devastating disease of rice (Oryza sativa) that is responsible for significant crop loss. Sugars and sugar metabolites are important for pathogen infection, providing energy and regulating events associated with defense responses; however, the mechanisms by which they regulate such events in BB are unclear. As an inevitable sugar metabolite, methylglyoxal (MG) is involved in plant growth and responses to various abiotic stresses, but the underlying mechanisms remain enigmatic. Whether and how MG functions in plant biotic stress responses is almost completely unknown. Here, we report that the Xoo strain PXO99 induces OsWRKY62.1 to repress transcription of OsGLY II genes by directly binding to their promoters, resulting in overaccumulation of MG. MG negatively regulates rice resistance against PXO99: osglyII2 mutants with higher MG levels are more susceptible to the pathogen, whereas OsGLYII2-overexpressing plants with lower MG content show greater resistance than the wild type. Overexpression of OsGLYII2 to prevent excessive MG accumulation confers broad-spectrum resistance against the biotrophic bacterial pathogens Xoo and Xanthomonas oryzae pv. oryzicola and the necrotrophic fungal pathogen Rhizoctonia solani, which causes rice sheath blight. Further evidence shows that MG reduces rice resistance against PXO99 through CONSTITUTIVE DISEASE RESISTANCE 1 (OsCDR1). MG modifies the Arg97 residue of OsCDR1 to inhibit its aspartic protease activity, which is essential for OsCDR1-enhanced immunity. Taken together, these findings illustrate how Xoo promotes infection by hijacking a sugar metabolite in the host plant.