Risk behaviour and egocentric sexual network data collected from a large random sample of young gay men in San Francisco were analysed to assess the importance of sexual mixing (i.e. sexual networks) in the acquisition of HIV. These data were collected in 1993, during wave one of a longitudinal cohort study of HIV transmission in gay men; the seroprevalence level in the sample was 18%. We identify recent sexual mixing patterns and we demonstrate that seropositives and seronegatives have very different age-stratified sexual mixing patterns. We show that sexual mixing can explain the current seroprevalence patterns in the young gay community; seroprevalence levels in risk groups reflect the degree of sexual mixing with the older (and more heavily infected) age group. Our results suggest that seropositives became infected with HIV not simply owing to an increased rate of acquisition of sex partners, but also as a result of their sexual mixing pattern. We develop and apply a simple methodology that uses the sexual network data in combination with risk behaviour data to estimate the future number of seroconverters. Our methodology is validated by testing our predictions against the observed seroconversion data collected during wave two of the cohort study in 1994. Our analyses empirically demonstrate (for the first time) the significance of sexual mixing as a risk factor for HIV transmission.