Previous studies have shown that dietary resveratrol (RES) reduces diarrhea and attenuates oxidative stress in piglets challenged with diquat. However, the effect of dietary resveratrol on the gut microbiota of these piglets, as well as the potential relationships between intestinal microflora and metabolites, remain unclear. Here, 16S ribosomal DNA sequencing and metabolome analyses were performed to investigate the effect of RES on the gut microbiota and metabolome of diquat-challenged piglets. A total of 18 weaned piglets (aged 28 ± 2 days) were divided into the control group (basal diet), diquat group (basal diet + diquat challenge), and RES group (basal diet containing 90 mg/kg RES + diquat challenge). Compared with the control group, piglets in the diquat group showed enriched relative abundance of the phyla Firmicutes and Actinobacteria, the genus Ruminococcaceae UCG-005, and members of the Eubacterium coprostanoligenes group. Noteworthy, RES supplementation significantly reduced the levels of these microorganisms. In contrast, the relative abundance of some beneficial bacterial species in the RES group, such as the genera Clostridium sensu stricto 1 and Lachnospiraceae unclassified were significantly higher than in the diquat and control groups. Metabolomic analysis indicated that some metabolites, including indole-3-carbinol, 5-hydroxyindole-3-acetic acid, and uridine, were significantly upregulated upon RES supplementation. In particular, the relative abundance of uridine, indole, and alpha- and beta-dihydroresveratrol was significantly higher in the RES group than in the control group. Moreover, most gut bacterial genera were found to be highly correlated with altered gut microbiota-related metabolites. These findings suggest that dietary supplementation with resveratrol may alter the composition and metabolites of colonic microbiota in diquat-challenged piglets, which provides important insights into the use of resveratrol as a feed additive for gut microbial regulation in piglets with inflammatory and oxidative stress-associated disorders.