HIV and HTLV seroprevalence was determined by means of unlinked anonymous testing of 2144 sera, originally obtained from primary care patients by representative sampling of the Spanish population aged 15-39 years in 1996. HIV-1 seroprevalence was 4·3 per 1000 population in the 15–39 years age group [95% confidence interval (CI), 1·5–10·7] and 5·6 per 1000 (95% CI, 1·8–15·3) in the 20–39 years age group. Seroprevalence proved higher in males and urban residents. No antibodies to HIV-2 and HTLV-I were detected in any of the sera studied. However, presence of antibodies to HTLV-II was confirmed in one serum sample, while HTLV seroreactivity, though detected in another, could not be typed. The two HTLV-positive results equated to a seroprevalence of 1·9 per 1000 in the 20–39 years age group (95% CI, 0·3–8·6). HIV-1 seroprevalence was consistent with previous estimates yielded by back-calculation. The level of HTLV seroprevalence found suggests endemicity.