BackgroundStudies have suggested that the injection drug use (IDU) was no longer the main transmission route of HIV/AIDS in China. However, there has never been a study to assess the national HIV epidemic among persons who inject drugs (PWIDs) based on a nationwide database.MethodsPWIDs among new entrants in detoxification centers with HIV test results were extracted from the 2008–2016 National Dynamic Management and Control Database for Persons Who Use Drugs (NDMCD). Logistic regressions were used to analyze factors associated with HIV infection, and joinpoint regression were used to examine trends in the HIV prevalence.ResultsA total of 103,619 PWIDs among new entrants tested for HIV in detoxification centers between 2008 and 2016 were included in the analysis. The HIV prevalence was 5.0% (n = 5167) among PWIDs. A U-shaped curve of the HIV prevalence decreased from 4.9% in 2008 to 3.3% in 2010 (Annual Percent Change [APC] − 20.6, 95% CI − 32.5 to − 6.7, p < 0.05) and subsequently increased from 3.3% in 2010 to 8.6% in 2016 (APC 17.9, 95% CI 14.5–21.4, p < 0.05) was observed. The HIV prevalence in west regions in China all presented decreased trends, while central and eastern regions presented increased trends.ConclusionsAlthough the HIV prevalence has been declining in general population, the HIV prevalence among PWIDs has shown an increasing trend since 2010. Current policies on HIV control in PWIDs should be reassessed.