Studies have documented the substantial risk of human immunodeficiency virus (HIV) infection endured by sex-trafficked women, but it remains unclear how exposure to trafficking puts its victims at risk. We assessed whether the association between sex trafficking and HIV could be explained by self-reported forced prostitution or young age at entry into prostitution using cross-sectional data collected from 1,814 adult female sex workers in Karnataka, India, between August 2005 and August 2006. Marginal structural logistic regression was used to estimate adjusted odds ratios for HIV infection. Overall, 372 (21%) women met 1 or both criteria used to define sex trafficking: 278 (16%) began sex work before age 18 years, and 107 (5%) reported being forcibly prostituted. Thirteen (0.7%) met both criteria. Forcibly prostituted women were more likely to be HIV-infected than were women who joined the industry voluntarily, independent of age at entering prostitution (odds ratio = 2.30, 95% confidence interval: 1.08, 4.90). Conversely, after adjustment for forced prostitution and other confounders, no association between age at entry into prostitution and HIV was observed. The association between forced prostitution and HIV infection became stronger in the presence of sexual violence (odds ratio = 11.13, 95% confidence interval: 2.41, 51.40). These findings indicate that forced prostitution coupled with sexual violence probably explains the association between sex trafficking and HIV.