This study aims to investigate the prevalence and factors affecting stress, anxiety, and depression of medical students in a public university in Malaysia. Medical students of years 1 to 5 were invited to answer an anonymised Depression, Anxiety, and Stress Scale-21 (DASS-21) questionnaire. Sociodemographic data were also collected. The results were analysed using descriptive and univariate/multivariate logistic regression analyses. Out of 907 participants, 35.2% reported to having stress, anxiety 43.5% and depression 7.1%. Students in year 1 were more likely to be anxious compared to year 5 [β: 2.059; 95% CI: (1.247, 3.398); p = 0.014], and those from B40-families were more likely to be stressed [β: 1.79; 95% CI: (1.183, 2.718); p = 0.006] compared to T20-families. Those without psychiatric and medical illnesses had 80% [β: 0.202; 95% CI: (0.69, 0.597); p = 0.004] and 34% [β: 0.666; 95% CI: (0.445, 0.994); p = 0.047] reduction in stress level, while 86% [β: 0.143; 95% CI: (0.038, 0.535); p = 0.004] and 39% [β: 0.614; 95% CI: (0.409, 0.923); p = 0.019] had reduction in anxiety levels. In addition, those without psychiatric illness had 91% [β: 0.094; 95% CI: (0.032, 0.275); p = <0.001] reduction in depressive symptoms. Those who considered counselling were 1.8 times more likely to be stressed [β: 1.849; 95% CI: (1.367, 2.500); p = <0.001] and had anxiety [β: 1.879; 95% CI: (1.387, 2.545); p = <0.001]. There is a moderate prevalence of anxiety and stress among medical students, but a low occurrence of depression. Being in year 1, B40 socioeconomic group, having medical and psychological illnesses resulted in a higher risk of stress, anxiety and depression.