Optimal obstetric and neonatal care requires the provision of adequate analgesia for painful procedures. However, anesthetic and analgesic agents have the potential to adversely impact the developing fetal/neonatal brain. In this setting, clinicians must assess the risks and benefits of pharmacologic anesthesia and analgesia for specific indications in this population. General anesthesia is required for non-obstetric surgery and cesarean section in the absence of neuraxial anesthesia for the health of the mother and fetus. Although experimental data raise concerns, human data are reassuring and future research may focus on neuroprotective adjuncts in the setting of repeated or prolonged anesthetic exposures. Opioid analgesia is standard of care for preterm infants undergoing major procedures including invasive surgery and endotracheal intubation. The use of opioids for agitation resulting from mechanical ventilation is controversial, but prevalent. Randomized and retrospective studies detect short-term toxicity with inconclusive long-term impact, suggesting the need to explore alternative therapies.