Given the potential for nosocomial outbreaks, we must understand factors associated with negative vaccine attitudes amongst healthcare professionals (HCPs) before the rollout of a newly developed vaccine in a pandemic setting. The aim of this prospective cohort study was to study the impact of preexisting and prevailing mental health on United Kingdom HCPs’ attitudes towards a newly developed COVID-19 vaccine. Two online surveys were distributed: first during vaccine development (July–September, 2020) and second during nationwide vaccine rollout (December 2020–March 2021). Mental health (PHQ-9 for depression; GAD-7 for anxiety) was assessed in both surveys. Negative attitude regarding vaccine safety and vaccine effectiveness was assessed at vaccine rollout. A series of logistic regression models were developed relating mental health (preexisting during vaccine development, ongoing and new-onset during rollout, and changes in symptom severity) to negative vaccine attitudes. In 634 HCPs, the presence of depression and/or anxiety during vaccine development was associated with elevated negative attitude towards vaccine safety (adj. OR 1.74 [95% CI 1.10–2.75],
p
= .02), but not vaccine effectiveness (1.13 [0.77–1.66],
p
= .53) at rollout. This was independent of other characteristics: age, ethnicity, professional role, and history of contracting COVID-19. Ongoing depression and/or anxiety (1.72 [1.10–2.69],
p
= .02) was associated with elevated negative attitude regarding vaccine effectiveness, but not vaccine safety. Worsened combined symptom scores over time were associated with elevated negative vaccine effectiveness attitudes (1.03 [1.00–1.05],
p
< .05), but not vaccine safety. Overall, adverse mental health can impact on HCPs’ attitudes towards a newly developed vaccine. Further work is required to understand how this translates to vaccine uptake.