Adolescent chronic pain is a growing public health epidemic. Our understanding of its etiology is limited; however, several factors can increase susceptibility, often developing in response to an acute pain trigger such as a surgical procedure or mild traumatic brain injury (mTBI), or an adverse childhood experience (ACE). Additionally, the prevalence and manifestation of chronic pain is sexually dimorphic, with double the rates in females than males. Despite this, the majority of pre-clinical pain research focuses on males, leaving a gap in mechanistic understanding for females. Given that emerging evidence has linked the gut microbiome and the brain-gut-immune axis to various pain disorders, we aimed to investigate sex-dependent changes in taxonomic and functional gut microbiome features following an ACE and acute injury as chronic pain triggers. Male and female Sprague Dawley rat pups were randomly assigned to either a maternal separation (MS) or no stress paradigm, then further into a sham, mTBI, or surgery condition. Chronically, the von Frey test was used to measure mechanical nociception, and fecal samples were collected for 16S rRNA sequencing. Animals in the surgery group had an increase in pain sensitivity when compared to mTBI and sham groups, and this was complemented by changes to the gut microbiome. In addition, significant sex differences were identified in gut microbiome composition, which were exacerbated in response to MS. Overall, we provide preliminary evidence for sex differences and ACE-induced changes in bacterial composition that, when combined, may be contributing to heterogeneity in pain outcomes.