The aim of the study was to estimate the prevalence and risk factors associated with infection by high-risk human papillomavirus (HR-HPV) in cervix and squamous intra-epithelial lesions (SIL) in imprisoned women. This was done by a cross-sectional study of imprisoned women attending the gynaecological clinic in Foncalent prison in Alicante, Spain. The study period was from May 2003 to December 2005. HR-HPV infection was determined through Digene HPV Test, Hybrid Capture II (HC-II). HPV typing was determined by multiplex nested PCR assay combining degenerate E6/E7 consensus primers. Multiple logistic regression modelling was used for the analysis of associations between variables where some were considered possible confounders after checking for interactions. A total of 219 women were studied. HR-HPV prevalence was 27·4% and prevalence of SIL was 13·3%. HIV prevalence was 18%, higher in Spaniards than in migrant women (24·6% vs. 14·3%, P<0·05). In multivariate analyses, risk factors for HPV infection were younger age (P for trend=0·001) and tobacco use (OR 2·62, 95% CI 1·01–6·73). HPV infection (OR 4·8, 95% CI 1·7–13·8) and HIV infection were associated with SIL (OR 4·8, 95% CI 1·6–14·1). The commonest HPV types were HPV16 (29·4%), HPV18 (17·6%), HPV39 (17·6%) and HPV68 (17·6%). The prevalence of both HR-HPV infection and SIL in imprisoned women found in this study is high. Determinants for each of the outcomes studied were different. HPV infection is the most important determinant for SIL. A strong effect of HIV co-infection on the prevalence of SIL has been detected. Our findings reinforce the need to support gynaecological clinics in the prison setting.