Substantial variation exists in response to standard doses of codeine ranging from poor analgesia to life-threatening central nervous system (CNS) depression. We aimed to discover the genetic markers predictive of codeine toxicity by evaluating the associations between polymorphisms in cytochrome P450 2D6 (CYP2D6), UDP-glucuronosyltransferase 2B7 (UGT2B7), P-glycoprotein (ABCB1), mu-opioid receptor (OPRM1), and catechol O-methyltransferase (COMT) genes, which are involved in the codeine pathway, and the symptoms of CNS depression in 111 breastfeeding mothers using codeine and their infants. A genetic model combining the maternal risk genotypes in CYP2D6 and ABCB1 was significantly associated with the adverse outcomes in infants (odds ratio (OR) 2.68; 95% confidence interval (CI) 1.61-4.48; P(trend) = 0.0002) and their mothers (OR 2.74; 95% CI 1.55-4.84; P(trend) = 0.0005). A novel combination of the genetic and clinical factors predicted 87% of the infant and maternal CNS depression cases with a sensitivity of 80% and a specificity of 87%. Genetic markers can be used to improve the outcome of codeine therapy and are also probably important for other opioids sharing common biotransformation pathways.