Irritable bowel syndrome (IBS) is a common disorder characterized by altered gut function and often is accompanied by comorbid anxiety. Although changes in the gut microbiota have been documented, their relevance to the clinical expression of IBS is unknown. To evaluate a functional role for commensal gut bacteria in IBS, we colonized germ-free mice with the fecal microbiota from healthy control individuals or IBS patients with diarrhea (IBS-D), with or without anxiety, and monitored gut function and behavior in the transplanted mice. Microbiota profiles in recipient mice clustered according to the microbiota profiles of the human donors. Mice receiving the IBS-D fecal microbiota showed a taxonomically similar microbial composition to that of mice receiving the healthy control fecal microbiota. However, IBS-D mice showed different serum metabolomic profiles. Mice receiving the IBS-D fecal microbiota, but not the healthy control fecal microbiota, exhibited faster gastrointestinal transit, intestinal barrier dysfunction, innate immune activation, and anxiety-like behavior. These results indicate the potential of the gut microbiota to contribute to both intestinal and behavioral manifestations of IBS-D and suggest the potential value of microbiota-directed therapies in IBS patients.