In a cross-sectional study of 3,424 women from urban (Dar es Salaam) and rural (Pwani, Mwanza, and Mtwara) Tanzania, conducted in 2008-2009, we investigated risk factors for human immunodeficiency virus (HIV) and the association between different measures of human papillomavirus (HPV) and HIV positivity. Study participants were interviewed about socio-demographic and reproductive factors and sexual behavior. Blood samples were tested for HIV, and the women underwent a gynecological examination. HPV status was determined by Hybrid Capture 2, and HPV genotyping was performed using the LiPA Extra test. Multivariable logistic regression models estimating odds ratios (OR) and 95% confidence intervals (CI) were used. The overall HIV prevalence was 10.2%. HIV-positive women were more likely to have high-risk (HR) HPV detected (OR = 4.11; 95% CI: 3.23-5.24) and clinically visible genital warts (OR = 4.37; 95% CI: 1.81-10.5). Other risk factors included age, place of residence, education, number of births, lifetime number of sexual partners, and time in present relationship. HIV risk factors among urban and rural women and among HPV-positive and HPV-negative women were similar. HPV vaccination may provide some protection against HIV infection in Tanzania, but focus must still be on preventing established risk factors for HIV.