This study assessed the prevalence and patterns of drug use among people living with HIV (PLHIV) in Spain. We conducted an observational cross-sectional study including 1401 PLHIV. Data were collected through 33 sites across Spain using an online computer-assisted self-administered interview. The survey measured use of illicit drugs and other substances, treatment adherence and health-related variables. To analyse patterns of drug use we performed cluster analysis in two stages. The most frequently consumed substances were: alcohol (86.7%), tobacco (55.0%), illicit drugs (49.5%), other substances (27.1%). The most prevalent illicit drugs used were cannabis (73.8%), cocaine powder (53.9%), and poppers (45.4%). Results found four clusters of PLHIV who used drugs. Two of them were composed mainly of heterosexuals (HTX): Cluster 1 (n = 172) presented the lowest polydrug use and they were mainly users of cannabis, and Cluster 2 (n = 84) grouped mostly men who used mainly heroin and cocaine; which had the highest percentage of people who inject drugs and presented the lowest level of treatment adherence (79.8±14.2; p < .0001). The other two clusters were composed mainly of men who have sex with men (MSM), who were mostly users of recreational drugs. Cluster 3 (n = 285) reported moderate consumption, both regarding frequency and diversity of drugs used, while Cluster 4 (n = 153) was characterized by the highest drug polyconsumption (7.4±2.2; p < .0001), and 4 grouped MSM who injected recreational drugs, and who reported the highest frequency of use of drugs in a sexual context (2.6±0.8; p < .0001) and rates of sexually transmitted infections (1.8±1.1; p < .01). This is the largest multi-centre cross-sectional study assessing the current prevalence and patterns of drug use among PLHIV in Spain. The highest prevalence of drug use was found among MSM, although HTX who used heroin and cocaine (Cluster 2) had the most problems with adherence to HIV treatment and the worst health status.