Objective. To identify factors associated with opioid use during pregnancy and to compare perinatal morbidity, mortality, and healthcare costs between opioid users and nonusers. Methods. We conducted a cross-sectional analysis of pregnancy-related discharges from 1998 to 2009 using the largest publicly available all-payer inpatient database in the United States. We scanned ICD-9-CM codes for opioid use and perinatal outcomes. Costs of care were estimated from hospital charges. Survey logistic regression was used to assess the association between maternal opioid use and each outcome; generalized linear modeling was used to compare hospitalization costs by opioid use status. Results. Women who used opioids during pregnancy experienced higher rates of depression, anxiety, and chronic medical conditions. After adjusting for confounders, opioid use was associated with increased odds of threatened preterm labor, early onset delivery, poor fetal growth, and stillbirth. Users were four times as likely to have a prolonged hospital stay and were almost four times more likely to die before discharge. The mean per-hospitalization cost of a woman who used opioids during pregnancy was $5,616 (95% CI: $5,166–$6,067), compared to $4,084 (95% CI: $4,002–$4,166) for nonusers. Conclusion. Opioid use during pregnancy is associated with adverse perinatal outcomes and increased healthcare costs.