This study examined pre-service mathematics teachers' knowledge of history of mathematics and their attitudes and beliefs towards using history of mathematics in mathematics education based on year level in teacher education program and gender. The sample included 1,593 freshman, sophomore, junior, and senior pre-service middle school (grades 4-8) mathematics teachers from nine universities in Turkey. Data were collected through Knowledge of History of Mathematics Test and Attitudes and Beliefs towards the Use of History of Mathematics in Mathematics Education Questionnaire. Results indicate that pre-service teachers have moderate knowledge of history of mathematics and positive attitudes and beliefs towards using history of mathematics. Their knowledge scores increase as the year level in teacher education program advanced. Males' knowledge scores are significantly higher than females' scores in the first 2 years. This situation reverses in the last 2 years, but it is not statistically significant. Pre-service teachers have more positive attitudes and availing beliefs towards using history of mathematics as they progress in their teacher education program. Females have greater attitudes and beliefs mean scores than males in each of the years. The results indicate that the teacher education program may have enhanced the pre-service teachers' knowledge of history of mathematics by related courses. However, the moderate knowledge scores indicate that there is a need for revision of these courses. The pre-service teachers' positive attitudes and beliefs towards using history of mathematics stress the importance of teacher education program in order to prepare them for implementing this alternative strategy in the future.