This paper presents the results of a cross-sectional biomedical and social survey, conducted in a major goldmining centre with a high prevalence of HIV infection. It also provides the baseline data for a comprehensive intervention programme. Our sample comprised a stratified random group of migrant mineworkers and of the resident adult population living in the community close to the mines and a small convenience sample of sex workers. In total, 2231 people between 13 and 59 years of age were interviewed using a structured questionnaire covering a wide range of psychological, behavioural and social issues. Blood and urine samples were collected and tested for the presence of HIV and syphilis antibodies and infection with Neisseria gonorrhoeae and Chlamydia trachomatis. The prevalence of HIV was high in all groups: 22% of the men and 37% of the women in the community, 29% of the mineworkers and 69% of the sex workers, were infected with HIV. The prevalence of other sexually transmitted infections (STIs), and especially syphilis, was also high in all four groups of people. Levels of migrancy were highest among mineworkers and sex workers. Migrants had a higher prevalence of casual partners than more permanent residents. More than 43% of the men in the study were circumcised and circumcision appears to offer some protection from HIV infection but not from other STIs. Knowledge about HIV was high but perceived vulnerability was low, which contributed to a high prevalence of unsafe behaviours. Social capital was also associated with HIV infection, with membership of sports clubs, youth clubs, burial societies and churches offering a protective effect against infection, while membership of stokvels (rotating credit associations) was associated with an increased chance of infection. Successful and sustainable intervention programmes must include a range of activities tailored to the needs of the community. Community-based peer education, focus group discussion and involvements of stakeholders should be complemented with syndromic management of STIs as well as periodic presumptive treatment of the sex workers, a partner notification system and training for local physicians.