BackgroundThe HIV/AIDS (human immunodeficiency virus/acquired immune deficiency syndrome) remains a global threat to health. Suicidal ideation has been a serious public health problem among people living with HIV (PLWH). However, the suicide prevention mechanism among PLWH still unclear. This study aims to analyze the suicidal ideation and its related factors in PLWH, and further explore the relationships between suicidal ideation and depression, anxiety and perceived social support.MethodsThis is a cross-sectional study. A total of 1146 PLWH were investigated by the general information questionnaire, the perceived social support scale (PSSS), the Beck scale for suicide ideation of Chinese version (BSI-CV), the generalized anxiety disorder scale-2 (GAD-2) and the patient health questionnaire-2 (PHQ-2) though the WeChat in China in 2018. By using statistical description and the binary unconditional logistic regression, we assessed the incidence of suicidal ideation and its related factors in PLWH. Besides, the intermediary effect of social support between anxiety, depression and suicidal ideation were explored by the stepwise test and Bootstrap method.ResultsThe incidence of suicide ideation was 54.0% (619/1146) among the PLWH in the last week or during the most serious depression. Binary logistic regression analysis results showed that the PLWH who with short time for HIV positive diagnosis (aOR(adjusted odd ratio) = 1.754, 95% CI (confidence interval):1.338–2.299), low monthly income (aOR= 1.515, 95%CI:1.098–2.092), other chronic diseases except HIV (aOR= 1.555, 95%CI:1.134–2.132), irregular lovers (aOR= 1.369, 95%CI:1.021–1.837), anxiety (aOR= 2.711, 95%CI:1.767–4.161), depression (aOR= 1.614, 95%CI:1.078–2.417), low PSSS (aOR= 2.139, 95%CI:1.345–3.399) had high risk of suicide ideation.The social support played a mediating role between the anxiety (the mediating effect accounted for 30.43% of the total effect), depression (the mediating effect accounted for 23.76% of the total effect) and the suicide ideation among PLWH.ConclusionThe incidence of suicide ideation of PLWH was high. Anxiety, depression, and social support are the key factors of suicide ideation of PLWH. Social support plays a partial mediating role between anxiety, depression and suicidal ideation, which provides a new approach for prevention of suicidal ideation in PLWH and should be known widely for people to prevent suicide.