Opioid medications are increasingly used to treat chronic pain. Opioid-associated respiratory depression, and their potential to cause nocturnal apneas, is increasingly recognized as a major contributor to nocturnal hypoxemia and sleep-disordered breathing. Given the widespread use of opioids, understanding their mechanism of action and their potential to cause adverse effects particularly during sleep is critical. This article reviews the salient features of the physiologic control of respiration and sleep, and the role opioids play in altering that regulation. Additionally, we summarize the evidence regarding the association between opioid use and sleep-disordered breathing and explore treatment modalities for opioid-associated nocturnal respiratory depression and apneas.