Opioid use during pregnancy affects over 7% of pregnancies in the United States. While efforts have been directed at mitigating effects of prenatal opioid exposure acutely in the neonatal period, long-term neurodevelopmental studies in humans remain challenging. Using a preclinical model, we previously found that perinatal morphine (MO) exposure induces sex-dependent executive function deficits in adult offspring, and sexually divergent shifts in microglia phenotype. Therefore, this study used transcriptional profiling to test whether perinatal MO exposure would cause sex-specific transcriptional changes in microglia that would relate to offspring executive function outcomes in BXD F1 mice. Female C57BL/6 mice were given MO via the drinking water or saccharin only (SCH) one week prior to mating with DBA males, throughout gestation, and lactation until offspring were weaned. Offspring executive function was assessed in adulthood using the 5-choice serial reaction time task (5CSRTT), and microglia from the PFC were isolated and characterized via RNA-seq. In the 5CSRTT, male MO-exposed offspring had reduced accuracy and female MO-exposed offspring had increased inattentive behavior. There were a similar number of genes altered in female vs. male microglia, but only 3 differentially expressed genes were evident in both sexes. Further, hierarchical clustering analysis and WGCNA identified genes that related to behavioral deficits. Together, our data identify individual genes and pathways in microglia within each sex that may relate to executive function deficits observed after perinatal opioid exposure, even though the transcriptional profiles are highly divergent between the sexes.