ImportanceHepatitis C virus (HCV) microelimination aims to detect and treat hidden infections, especially in at-risk groups, like people experiencing homelessness (PEH) with alcohol or drug use disorders. Point-of-care HCV RNA testing and peer support workers are crucial for identifying and preventing HCV infection among marginalized populations, contributing to overall elimination goals.ObjectiveTo assess risk factors, prevalence, and trends of active HCV infection among PEH in Madrid, Spain (2019-2023).Design, Setting, and ParticipantsThis cross-sectional study was conducted between 2019 and 2023 in PEH, defined as people who lacked a fixed, regular, and adequate night residence, screened on the street or in homeless shelters via mobile unit using rapid HCV antibody testing, followed by HCV-RNA testing in Madrid, Spain. Data were analyzed from January to June 2024.Main Outcomes and MeasuresActive HCV infection among PEH was the main outcome. Risk factors analyzed included being born outside of Spain, alcohol misuse, lacking financial income, benzodiazepine use, injection drug use (IDU; including nonactive IDU and active IDU within the last year), opioid substitution therapy participation, and sexual behavior patterns. Data were analyzed using logistic regression. P values were adjusted for multiple testing using the false discovery rate (q-values).ResultsA total of 4741 individuals were screened for HCV infection, of whom 2709 (mean [SD] age, 42.2 [12.7]; 1953 [72.2%] men) were PEH and included in analysis. A total of 363 PEH (13.4%) had test results positive for HCV antibodies, of whom 172 (47.4%) had test results positive for HCV-RNA, and 148 of these (91.9%) started HCV treatment. Overall, active HCV infection prevalence was 6.3%, and the main risk factors associated with active HCV infection included IDU, encompassing both nonactive IDU (adjusted odds ratio [aOR], 10.9; 95% CI, 6.1-19.4; q < .001) and active IDU in the last year (aOR, 27.0; 95% CI, 15.2-48.0; q < .001); a lack of financial income (aOR, 1.8; 95% CI, 1.1-2.9; q = .03); and alcohol misuse (aOR, 1.8; 95% CI, 1.3-2.6; q = .008). There was a significant decrease between 2019 and 2023 in active HCV infection prevalence across the entire population, from 7.2% to 3.4% (P = .04).Conclusions and RelevanceIn this cross-sectional study of PEH in Madrid, IDU, lack of income, and alcohol misuse were primary risk factors associated with HCV infection. The significant decline in HCV rates observed across all risk groups during the study period suggests preventive policies were effective in reducing HCV prevalence among the homeless population.