The gut microbiota influences many physiological processes in mammals, and disruption of this diverse bacterial community can impair liver function, leading to disease. However, the molecular mechanisms of gut microbiota–intestine–liver communication are unclear. By analyzing public hepatic transcriptomics datasets, researchers recently identified pregnane X receptor (PXR) as a regulator of many differentially expressed genes in microbe-free vs. normal mice. The PXR target genes were largely associated with xenobiotic metabolism. Additional experiments in mice revealed that PXR deletion induced sex-specific changes in gut microbiota composition and hepatic gene expression. Microbiota depletion with antibiotics also induced PXR-dependent alterations in hepatic gene expression that differed between male and female mice. Further studies in male mice confirmed that elimination of the microbiota altered hepatic lipid and xenobiotic metabolism, and this effect was dependent on the presence of PXR. Overall, the findings reveal that PXR is a hepatic sensor of gut microbe-derived signals in mice that responds by affecting metabolic processes differently in males and females. Although experiments in humans are needed, these results may provide insight into the pathogenesis of liver disease and suggest a new mechanism for unexpected drug and dietary interactions.