Background. Efavirenz and nelfinavir are metabolized by cytochrome P-450 (CYP) 2B6 and CYP2C19, respectively, with some involvement by CYP3A. Nelfinavir is a substrate for P-glycoprotein, which is encoded by MDR1. The present study examined associations between genetic variants and long-term responses to treatment. Methods. Adult AIDS Clinical Trials Group study 384 randomized antiretroviral-naive subjects to receive efavirenz and/or nelfinavir plus 2 nucleoside analogues, with follow-up lasting up to 3 years. Population pharmacokinetics were estimated from a nonlinear mixed-effects model. Polymorphisms in CYP2B6, CYP2C19, CYP3A4, CYP3A5, and MDR1 were characterized. Results. The 504 participants in the genetic study included 340 efavirenz recipients and 348 nelfinavir recipients (184 of the 504 participants received both efavirenz and nelfinavir). Of the participants, 49% were white, 31% were black, and 19% were Hispanic. Plasma exposure to efavirenz and nelfinavir in each population was significantly associated with the polymorphisms CYP2B6 516G→T and CYP2C19 681G→A, respectively. Among efavirenz recipients, the MDR1 position 3435 TT genotype was associated with decreased likelihood of virologic failure and decreased emergence of efavirenz-resistant virus but not with plasma efavirenz exposure. Among nelfinavir recipients, a trend toward decreased virologic failure was associated with the polymorphism CYP2C19 681G→A. Conclusions. Genetic variants predict plasma exposure to efavirenz and nelfinavir, and they may predict virologic failure and/or emergence of drug-resistant virus. These associations with treatment responses must be validated in other studies.