This study will enroll opioid-dependent pregnant women who are 13 to 30 weeks pregnant and will follow each woman and her child throughout the pregnancy until 6 weeks postpartum. All participants will undergo an initial screening that will last several hours. Participants will then be randomly assigned to receive either methadone or buprenorphine on a daily basis, and will be required to visit the clinic each day to receive their medication. Outcome measurements will be assessed at weekly study visits throughout the pregnancy, and will include drug use, HIV risk behaviors, medication dose adequacy and safety, treatment retention, and psychosocial functioning. Urine samples will be collected 3 times a week, and blood will be drawn throughout the pregnancy for safety monitoring. Outcome measurements related to the baby will include head circumference measurement, length of hospital stay, severity and frequency of withdrawal symptoms, and amount of medication needed to control withdrawal symptoms.