Background: Sleep is a fundamental factor associated with chronic illness. Lack of quality sleep and the extent of sleep may affect several aspects of physical, emotional, and cognitive health. Aim and objective: The study aims to assess sleep quality and associated factors in subjects diagnosed with diabetes mellitus using Pittsburgh Sleep Quality Index Questionnaire (PSQI). Materials and methods: An eight-month prospective cross-sectional study involving 356 patients with diabetes mellitus was carried out. The patient data collection form was prepared per the study's needs. Patients' responses to questionnaires about their sleep quality, anxiety, depression possibility, and physical activity were recorded. The data were analysed using a statistical tool for the social sciences (SPSS) version 28.0. Results: Among 356 subjects enrolled, 43 (12%) had poor sleep quality, rest of the 313 (88%) patients had good sleep quality. Poor sleep quality was observed between the age group of 51-70 years. When compared to women, men were generally shown to have poor sleep quality. When compared to patients with mild and moderate anxiety, it was observed that most of the subjects with severe anxiety had poor sleep quality. Poor sleep quality was reported by the majority of patients who tested positive for depression and inadequate physical activity. Conclusion: The study concluded that diabetes mellitus does not significantly affect sleep quality in most patients. However, patients with low physical activity, severe anxiety and depression had poor sleep.