Idiopathic pulmonary fibrosis (IPF) is a chronic, progressive, irreversible interstitial lung disease, with no effective cure. Polydatin is a resveratrol glucoside with strong antioxidant, anti-inflammatory and anti-apoptotic properties, which is used for treating health-related disorders such as cardiac disabilities, various types of carcinoma, hepatitis and hepatic fibrosis. The present study aimed to investigate the protective effect of polydatin against bleomycin-induced IPF and the possible underlying mechanism. A549 cells were treated with transforming growth factor-β1 (TGF-β1) and polydatin to observe phenotypic transformation and the related gene expression was detected. Sprague-Dawley rats were divided into seven groups and intratracheally infused with bleomycin to establish a pulmonary fibrosis model (the sham control group received saline). The rats were given pirfenidone (50 mg/kg), resveratrol (40 mg/kg) and polydatin (10, 40 and 160 mg/kg) for 28 days. The results demonstrated that polydatin had low toxicity to A549 cells and inhibited TGF-β1-induced phenotypic transformation as determined by MTS assay or observed using a light microscope. It also decreased the gene expression levels of α-smooth muscle actin and collagen I and increased the gene expression levels of epithelial cell cadherin in vitro and in vivo by reverse transcription-quantitative PCR. Furthermore, polydatin ameliorated the pathological damage and fiber production in lung tissues found by hematoxylin and eosin staining and Masson trichrome staining. Polydatin administration markedly reduced the levels of hydroxyproline, tumor necrosis factor-α, interleukin (IL)-6, IL-13, myeloperoxidase and malondialdehyde and promoted total superoxide dismutase activity in lung tissues as determined using ELISA kits or biochemical reagent kits. It inhibited TGF-β1 expression and phosphorylation of Smad 2 and 3 and ERK-1 and-2 in vivo as determined by western blot assays. These results suggest that polydatin protects against IPF via its anti-inflammatory, antioxidant and antifibrotic activities, and the mechanism may be associated with its regulatory effect on the TGF-β pathway.