Background and purpose: In the contemporary era, ensuring the health of the citizens of a society is one of the most important basic issues in any country that should be viewed from three dimensions: physical, mental and social. The psychological dimension of health has not been given enough attention in many countries of the world, even in Islamic countries. This study aimed to ensure the mental health of students of Yasouj University of Medical Sciences has investigated the relationship between religion and the key role of prayer with mental health. Materials and Methods: The present study is a part of applied studies in terms of purpose, a part of descriptive-comparative correlational studies in terms of method and a quantitative part of studies in terms of data collection method. The method of selecting the sample size was a multi-stage cluster in which the subjects answered the demographic questionnaire, general health questionnaire, and prayer questionnaire. The results were statistically analyzed. Pearson correlation method was used to test the hypotheses. Findings: According to the findings of this study, there is a significant relationship between mental health and performing the obligatory prayers among students of Yasouj University of Medical Sciences. Considering the value of Pearson coefficient obtained 0. 16, its significance level is 0. 001, so it can be said that in this hypothesis, the correlation coefficient between the two variables has a positive sign. Conclusion: The results of this study showed that almost 100% of prayer students in terms of different genders, celibacy, dormitory or non-dormitory, native and non-native based on self-expression in the questionnaire felt calm. Therefore, performing the duty of prayer is effective on the mental health of students.