Setting: The prison population is considered to be at high risk of tuberculosis infection and illness. Therefore, a tuberculosis prevention and control program was put into effect upon the opening of a penitentiary center in Barcelona whose inmates suffered a high prevalence of intravenous drug use (IVDU) (48.4%) and HIV-1 infection (36.0%). Objective: To ascertain the prevalence of tuberculosis infection and pulmonary tuberculosis detected on admission to jail among those prisoners who had no history of tuberculosis; and to study as predictors of tuberculosis infection and illness the variables age, IVDU and HIV-1 infection. Design: Cross-sectional study. Results: Of the 729 prisoners studied, 56.2% were considered infected with Mycobacterium tuberculosis. Age was the only variable associated with the infection, with an Odds Ratio (OR) of 1.017 per year (Confidence Interval [CI] 95% = 1.006-1.029) (P = 0,004). The rates of HIV-1 and M. tuberculosis co-infection, which may run between 18.9% and 21.7%, reached 42.8% in the IVDU. A 2.7% prevalence of pulmonary tuberculosis was observed. The most accurate logistic regression model for pulmonary tuberculosis diagnosis (P = 0.09) includes the variables tuberculosis infection (OR = 13.00; CI 95% = 1.7-98), IVDU (OR = 2.60; CI 95% = 0.66-7.81) and age (OR = 1.05; CI 95% = 0.99-1.11). Conclusion: Given the high prevalences observed, we propose the activation and maintenance of programs designed to seek out and identify cases of M. tuberculosis infection and illness within the prison population.