Abstract Education of young researchers has been proposed as a way to promote research integrity. However, the effectiveness of research integrity education on PhD students is unknown. In a longitudinal design, we surveyed over 1000 starting PhD students from various disciplines regarding knowledge, attitude and behaviour before, immediately after and 3 months after a compulsory 3-h course given by a panel of experts. Compared with a control group who did not follow the course, the course recipients showed significant (multivariate analysis) but modest improvements in knowledge and attitude scores immediately after the course, but not after 3 months; a prolonged impact was apparent regarding behaviour. Moreover, the course spurred 93% of PhD students to have conversations about research integrity and 79% declared applying the content of the course. Among other interventions, formal education in research integrity may contribute to foster a climate of research integrity in academia.