Diabetes mellitus is a major worldwide health concern. Diabetes has been associated with a number of adverse mental health conditions including depression, anxiety, and loneliness that can negatively impact diabetes outcomes. This study aimed to investigate factors associated with depression, anxiety, and loneliness in people, in the community, suffering with diabetes in Bangladesh. A cross-sectional study was conducted with 600 people with type-2 diabetes (54.83% females; mean age: 52.70 ± 11.56 years) between July and September 2022. Purposive sampling method was used to recruit the participants. A validated semi-structured questionnaire was used to collect demographic and other data. Depression, anxiety, and loneliness were measured using the PHQ-9, GAD-7, and UCLA Loneliness scale, respectively. Bivariate and multivariable linear regression analyses were conducted to ascertain factors that were significantly associated with these mental health conditions. The prevalence of depression, anxiety, and loneliness was 31.17%, 21.83%, and 28.00%, respectively. A lack of formal education, and not taking part in physical activities were significantly associated with all three mental health states. Duration of diabetes and being on medication for high cholesterol were also associated with depression and anxiety. Older age and being widowed were significantly associated with loneliness. This study found that depression, anxiety, and loneliness are prevalent among Bangladeshi people with diabetes, with certain sociodemographic and diabetes-related factors associated with increased risk. The findings emphasize the need for targeted interventions to people within the communities, at grassroot levels in order to improve reduce health inequality, and improve the mental health of people living with diabetes.