Objectives To determine the prevalence of symptoms of anxiety and depression in medical students and evaluate associated factors. Methods Cross-sectional study involving 234 students, who answered an online questionnaire containing sociodemographic factors and the Hospital Anxiety and Depression Scale (HADS). Results The mean score of the Hospital Anxiety and Depression Scale for anxiety was 6.7 (+/- 3.4), while 34.3% (80) of the students presented false-positive symptoms of anxiety and 19.7% (46) suggestive symptoms. In terms of depression the mean HADS score was 4.4 (+/- 3.1), with 19.3% (45) of the students presenting false-positive symptoms of depression and 5.6% presenting suggestive symptoms. In the univariate analysis, psychoactive drugs use was associated with symptoms of anxiety, for symptoms of depression, being from the Metropolitan Region of Recife (RMR) was found to be a protective factor, as illicit drugs use was associated to risk. Conclusion The prevalence of anxiety and depression symptoms, associated to the use of psychoactive and illicit drugs respectively, indicates the need for measures aimed at prevention and early diagnosis.