Background: Identifying factors affecting the quality of sleep in firefighters is of significant importance. Good sleep is one of the essential needs of firefighters, and poor sleep quality impairs their performance and decision making. The present study aimed to evaluate sleep quality and its relation with ergonomic, demographic, and psychological factors in firefighters employed in Qazvin. Methods: 118 firefighters from seven stations participated in this study. Data were gathered by questionnaires including demographic, Pittsburgh Sleep Quality Index, Beck Depression Inventory, HSE questionnaire for occupational stress, and Nordic questionnaire. Data were compared between two groups of firefighters with good and poor sleep quality. Then the data were analyzed using regression analysis. Results: 59.3% of firefighters had poor quality of sleep. Univariate analysis showed a significant correlation between sleep quality with musculoskeletal disorders, shift work, body mass index (BMI), and stress (P<0.05). In multivariate analysis, all variables except the occupational stress maintained their significant relationship with sleep quality. Conclusion: this study showed that musculoskeletal disorders (MSDs), shift work, and high body mass index are associated with poor sleep quality in firefighters. Proper timely interventions are suggested to prevent the complications of sleep disorders in firefighters.