Background: Endometriosis have a negative influence on women's sexual life. The aim of the current study was to test a conceptual model considering the interrelated role of anxiety, depression, sleep quality, physical activity, BMI, stage of endometriosis, the intensity of dyspareunia and pelvic pain on sexual function (SF) in infertile women with endometriosis. Also test the mediating role of sleep quality, anxiety, and depression.Method: In the present cross-sectional study, 220 infertile women with a laparoscopically confirmed endometriosis were recruited. Data were collected using a socio-demographic checklist, Female Sexual Function Index (FSFI), Pittsburgh Sleep Quality Index (PSQI), Hospital Anxiety and Depression Scale (HADS), Visual Analog Scale (VAS).Results: We found that anxiety, depression, sleep quality, BMI, level of education, stage of endometriosis, and dyspareunia have a direct effect on women's SF. In our study, sleep quality, anxiety, pelvic pain, and depression were the four major mediators that the higher scores lead to a decrease in the SF of endometriosis patients. The intensity of pelvic pain with an effect on sleep quality (SQ) and dyspareunia change women's SF. The lower level of physical activity, and higher BMI with indirect effect thorough anxiety, and SQ can worsen SF. Also, a higher level of anxiety leads to poor SQ and depression. Anxiety with both direct and indirect effect impress women's SF.Conclusion: It seems that the main risk factors for sexual dysfunction in women with endometriosis are higher rates of anxiety, depression, poor sleep quality, pelvic pain, and dyspareunia. In the care of women with endometriosis, not only laparoscopy and medical treatment should be performed but also psychotherapeutic and psychosexual help should be offered. [ABSTRACT FROM AUTHOR]