Background: Pain is the most common presenting complaint in patients visiting a healthcare facility. Healthcare professionals need adequate knowledge of pain to be able to manage it effectively.Aim: The aim of this study was to determine the pain knowledge and attitudes of the 2018 final-year medical students at the University of Cape Town (UCT).Setting: This study was conducted by the Department of Anaesthesia and Perioperative Medicine in the Faculty of Health Sciences, UCT, South Africa, with final-year medical students.Methods: Unruh’s Modified Pain Knowledge and Attitudes (MPKA) questionnaire was utilised to collect data in a cross-sectional survey using an Internet-based electronic format.Results: A total of 104 students out of 232 students in the class (44.8%) participated in the study. The total median score on the MPKA questionnaire was 46 (interquartile range [IQR] 44–50.5) out of 57, or 80.7% (IQR 77.2–88.6%). The participants performed worst in the section on the pharmacological management of pain with median scores of 6 (IQR 4–8) (55%) correct out of 11 questions.Conclusion: Pain knowledge, especially with regard to the pharmacological aspects of pain management, has some important deficiencies in these final-year medical students. It appears that the undergraduate curriculum and teaching thereof would benefit from a review of the pain curriculum.