This paper describes the sociodemographic and work characteristics, prevalence of HIV infection and associated risk behaviours among male sex workers (MSWs) in Madrid (Spain). Using an anonymous semi-structured questionnaire, educators attached to a mobile unit under a street-based prostitution programme surveyed 84 MSWs from several Madrid areas. Of the total surveyed: 35% were immigrants, mean age was 23 years, mean period in prostitution was four years; 21% had no primary education; 16% had injected drugs at some time; 11% reported private sexual relationships exclusively with women; 89% always used condoms in anal practices with clients; and 41% were in sexual relationships with their partners. Only 11% had ever used fortified condoms. In the preceding month, 37% had experienced condom failure, 82% without having used any lubricant. In all, 67% reported having undergone HIV testing, with a higher percentage of positive results among injecting (60%) versus non-injecting drug users (17%). Immigrants had a lower level of education, made less use of condoms, had more condom failures and, in their private lives, a greater proportion reported sexual relationships exclusively with women. In Spain, MSWs should be included in HIV prevention programmes, which ought to be specifically adapted to immigrants. Priority should be given to reducing the condom failure rate in anal intercourse, by improving access to fortified condoms.