The gut microbiota is found to be strongly associated with atherosclerosis (AS). Resveratrol (RSV) is a natural phytoalexin with anti-AS effects; however, its mechanisms of action remain unclear. Therefore, we sought to determine whether the anti-AS effects of RSV were related to changes in the gut microbiota. We found that RSV attenuated trimethylamine-N-oxide (TMAO)-induced AS in ApoE−/− mice. Meanwhile, RSV decreased TMAO levels by inhibiting commensal microbial trimethylamine (TMA) production via gut microbiota remodeling in mice. Moreover, RSV increased levels of the genera Lactobacillus and Bifidobacterium, which increased the bile salt hydrolase activity, thereby enhancing bile acid (BA) deconjugation and fecal excretion in C57BL/6J and ApoE−/− mice. This was associated with a decrease in ileal BA content, repression of the enterohepatic farnesoid X receptor (FXR)-fibroblast growth factor 15 (FGF15) axis, and increased cholesterol 7a-hydroxylase (CYP7A1) expression and hepatic BA neosynthesis. An FXR antagonist had the same effect on FGF15 and CYP7A1 expression as RSV, while an FXR agonist abolished RSV-induced alterations in FGF15 and CYP7A1 expression. In mice treated with antibiotics, RSV neither decreased TMAO levels nor increased hepatic BA synthesis. Additionally, RSV-induced inhibition of TMAO-caused AS was also markedly abolished by antibiotics. In conclusion, RSV attenuated TMAO-induced AS by decreasing TMAO levels and increasing hepatic BA neosynthesis via gut microbiota remodeling, and the BA neosynthesis was partially mediated through the enterohepatic FXR-FGF15 axis.