Patients with temporomandibular disorders (TMDs) often experience persistent facial pain. However, the treatment of TMD pain is still inadequate. In recent years, the disturbance of gut microbiota has been shown to play an important role in the pathogenesis of different neurological diseases including chronic pain. In the present study, we investigated the involvement of gut microbiota in the development of temporomandibular joint (TMJ) inflammation. Intra-temporomandibular joint injection of complete Freund's adjuvant (CFA) was employed to induce TMJ inflammation. Resveratrol (RSV), a natural bioactive compound with anti-inflammatory property, was used to treat the CFA-induced TMJ inflammation. We observed that CFA injection not only induces persistent joint pain, but also causes the reduction of short-chain fatty acids (SCFAs, including acetic acid, propionic acid and butyric acid) in the gut as well as decreases relevant gut bacteria Bacteroidetes and Lachnospiraceae. Interestingly, systemic administration of RSV (i.p.) dose-dependently inhibits CFA-induced TMJ inflammation, reverses CFA-caused reduction of SCFAs and these gut bacteria. Moreover, CFA injection causes blood–brain barrier (BBB) leakage, activates microglia and enhances tumor necrosis factor alpha (TNFα) release in the spinal trigeminal nucleus caudalis (Sp5C). The RSV treatment restores the BBB integrity, inhibits microglial activation and decreases the release of TNFα in the Sp5C. Furthermore, fecal microbiota transplantation with feces from RSV-treated mice significantly diminishes the CFA-induced TMJ inflammation. Taken together, our results suggest that gut microbiome perturbation is critical for the development of TMJ inflammation and that recovering gut microbiome to normal levels could be a new therapeutic approach for treating such pain.