Rationale: An alarming number of neonates born with prenatal exposure to morphine has resulted from the opioid epidemic; however, the long-term effects of prenatal opioid exposure on offspring behavior remain relatively unknown. In this study, we evaluated whether prenatal exposure to the mu opioid receptor agonist, morphine, has enduring effects on cognitive functions in adult life. Methods: On embryonic days 11–18 (E11-E18), female pregnant rats were injected subcutaneously with either morphine or saline twice daily. Adult male offspring that was prenatally exposed to saline or morphine was trained in the 5-choice serial reaction time test (5-CSRTT) to test their cognitive abilities under baseline conditions. Next, these rats were treated with saline (1 ml/kg), naloxone (1 mg/kg), and acute morphine (1, 3, 5 mg/kg), subcutaneously, once daily and following drug challenges rats were tested in the 5-CSRTT. Meanwhile, behavioral performance on training days between opioid drug challenges were analyzed to monitor possible drug-induced shifts in baseline performance. As a final experiment in order to investigate subchronic exposure to morphine, rats were injected with 5 mg/kg morphine for 5 days and then naloxone in the last day of the experiment (day 6). Results: Firstly, during acquisition of a stable baseline in the training phase, rats prenatally exposed to morphine showed delayed learning of the task demands. Furthermore, under baseline responding the rats prenatally exposed to morphine showed declined inhibitory control demonstrated by increased impulsive and compulsive-like responding compared to rats prenatally exposed to saline. Moreover, acute and subchronic morphine challenges in the rats prenatally exposed to morphine caused a deficit in visuospatial attention in comparison with saline treatment as well as the rats prenatally exposed to saline. These effects were abolished by naloxone. Conclusion: The current findings indicate a direct causal effect of prenatal morphine exposure on inhibitory control and task learning later in life, as well as deficits in attention following morphine exposure in adulthood.