OBJECTIVE The aim of this study is to investigate the attitudes towards mental illness and psychiatry among fifth year Spanish medical students. METHODS The study included 171 students from three medical schools located in different areas of Spain: Cádiz; UCA (n = 113), Madrid; San Pablo-CEU (n = 22), and Barcelona; UAB (n = 36). They responded, prior to their undergraduate medical course in psychiatry, to the AMI questionnaire to measure the attitudes towards mental illness and to Balon's adapted questionnaire to investigate their view towards psychiatry. RESULTS The students (93.4 %) had a positive attitude towards mental illness (AMI). Attitudes towards psychiatry were fairly positive with a few negative views, specifically regarding the role of psychiatrists (items 11 and 13) and the prestige of the specialty (item 16). There were some statistically significant differences between the three medical schools in the perception of psychiatry as a medical discipline. A better attitude towards mental illness was associated with a better view of the overall merits of psychiatry. CONCLUSIONS Findings suggest that Spanish medical students do not have a negative attitude towards mental illness and they have a good perception of psychiatry, although there are still some misconceptions about this specialty. These student's attitudes could favor an appropriate management of patients suffering from mental illness.