Sepsis is the predominant cause of mortality in ICUs, and opioids are the preferred analgesic in this setting. However, the role of opioids in sepsis progression has not been well characterized. The present study demonstrated that morphine alone altered the gut microbiome and selectively induced the translocation of Gram-positive gut bacteria in mice. Using a murine model of poly-microbial sepsis, we further demonstrated that morphine treatment led to predominantly Gram-positive bacterial dissemination. Activation of TLR2 by disseminated Gram-positive bacteria induced sustained up-regulation of IL-17A and IL-6. We subsequently showed that overexpression of IL-17A compromised intestinal epithelial barrier function, sustained bacterial dissemination and elevated systemic inflammation. IL-17A neutralization protected barrier integrity and improved survival in morphine-treated animals. We further demonstrated that TLR2 expressed on both dendritic cells and T cells play essential roles in IL-17A production. Additionally, intestinal sections from sepsis patients on opioids exhibit similar disruption in gut epithelial integrity, thus establishing the clinical relevance of this study. This is the first study to provide a mechanistic insight into the opioid exacerbation of sepsis and show that neutralization of IL-17A might be an effective therapeutic strategy to manage Gram-positive sepsis in patients on an opioid regimen.