Objectives To examine risk factors for HIV-1 infection in three geographic strata (main road trading centers that service local and international traffic, small trading villages on secondary dirt roads that serve as foci for local communications, and agricultural villages off main and secondary roads) in Rakai District, Uganda. Design and methods Serological, sociodemographic, knowledge/hehaviors and health survey conducted in 21 randomly selected community clusters; complete data were collected for 1292 consenting adults. Results Fifteen per cent of the men and 24% of the women were HIV-1-positive. On univariate analysis, several sociodemographic and behavioral factors were significantly associated with risk of HIV infection, including age, place of residence, travel, occupation, marital status, number of sex partners, sex for money or gifts, history of sexually transmitted disease (STD), and history of injections. On multivariate analysis, age, residence and number of sex partners remained significantly associated with HIV infection in both sexes; a history of STD and not having been circumcised were significant in men. There was a significant interaction between place of residence and reported number of sex partners: for any given level of sexual activity, the risk of HIV infection was markedly increased if the background community prevalence was high. Conclusion Sexual transmission appears to be the primary behavioral risk factor for infection, but the risks associated with this factor vary substantially between the three geographic strata. These data can be used to design targeted interventions.