BackgroundInfertility is increasingly recognized as a global health issue affecting couples of reproductive age, with male factors contributing to approximately 50% of infertility cases. However, the association between depression and anxiety-two of the most prevalent mental health conditions-and impaired male fertility remains a subject of ongoing debate.MethodsIn this cross-sectional study, male participants seeking fertility counseling at an IVF clinic were recruited. Symptoms of depression and anxiety were assessed using the Patient Health Questionnaire-9 (PHQ-9) and the Generalized Anxiety Disorder-7 (GAD-7), respectively. Generalized linear regression models (GLMs) were employed to investigate the relationships between mental health status and semen parameters.ResultsStatus of depression was negatively associated with semen quality parameters, whereas no statistically significant association was recognized between anxiety and semen quality except that sperm concentration was decreased by 25.60 (95% CI, 1.226 to 49.965, P=0.040) ×106/ml in moderate to severe anxiety group referring to normal group. Furthermore, when stratified by sleep duration, moderate to severe depression group showed a great decrease in progressive motility (PR), total motility, concentration and total sperm count (TSC) as referred to normal group in participants with sleep duration less than 7 hours.ConclusionThe present study revealed that depression rather than anxiety was a negative factor that affected semen quality, especially in individuals with shorter sleep duration.