A cross-sectional study was conducted in prisons of Cantabria (northern Spain) from June 1992 to December 1994. Inmates were asked to participate in a survey on prevalence and risk factors for monoinfections and coinfections with HIV, HBV and HCV. Crude and multiple odds ratios of risk factors were calculated (by polychotomous logistic regression). Prevalence of coinfections was higher than that of monoinfections. IDU risk factors were the main independent variables associated with monoinfections and coinfections with these agents. The strength of association increased with the degree of coinfection for IDU risk factors and penal status, e.g. duration of injecting drug use for more than 5 years yielded an adjusted OR ranging from 1·3 (95% CI: 0·4–5·1) for HBV monoinfection to 180 (95% CI: 61·0–540·0) for HIV–HBV–HCV coinfection. In comparison, sexual behaviours were less important than IDU risk factors.