BACKGROUND: The efficacy and safety profiles of vaccines against SARS-CoV-2 in patients with cancer is unknown. We aimed to assess the safety and immunogenicity of the BNT162b2 (Pfizer-BioNTech) vaccine in patients with cancer. METHODS: For this prospective observational study, we recruited patients with cancer and healthy controls (mostly health-care workers) from three London hospitals between Dec 8, 2020, and Feb 18, 2021. Participants who were vaccinated between Dec 8 and Dec 29, 2020, received two 30 μg doses of BNT162b2 administered intramuscularly 21 days apart; patients vaccinated after this date received only one 30 μg dose with a planned follow-up boost at 12 weeks. Blood samples were taken before vaccination and at 3 weeks and 5 weeks after the first vaccination. Where possible, serial nasopharyngeal real-time RT-PCR (rRT-PCR) swab tests were done every 10 days or in cases of symptomatic COVID-19. The coprimary endpoints were seroconversion to SARS-CoV-2 spike (S) protein in patients with cancer following the first vaccination with the BNT162b2 vaccine and the effect of vaccine boosting after 21 days on seroconversion. All participants with available data were included in the safety and immunogenicity analyses. Ongoing follow-up is underway for further blood sampling after the delayed (12-week) vaccine boost. This study is registered with the NHS Health Research Authority and Health and Care Research Wales (REC ID 20/HRA/2031). FINDINGS: 151 patients with cancer (95 patients with solid cancer and 56 patients with haematological cancer) and 54 healthy controls were enrolled. For this interim data analysis of the safety and immunogenicity of vaccinated patients with cancer, samples and data obtained up to March 19, 2021, were analysed. After exclusion of 17 patients who had been exposed to SARS-CoV-2 (detected by either antibody seroconversion or a positive rRT-PCR COVID-19 swab test) from the immunogenicity analysis, the proportion of positive anti-S IgG titres at approximately 21 days following a single vaccine inoculum across the three cohorts were 32 (94%; 95% CI 81-98) of 34 healthy controls; 21 (38%; 26-51) of 56 patients with solid cancer, and eight (18%; 10-32) of 44 patients with haematological cancer. 16 healthy controls, 25 patients with solid cancer, and six patients with haematological cancer received a second dose on day 21. Of the patients with available blood samples 2 weeks following a 21-day vaccine boost, and excluding 17 participants with evidence of previous natural SARS-CoV-2 exposure, 18 (95%; 95% CI 75-99) of 19 patients with solid cancer, 12 (100%; 76-100) of 12 healthy controls, and three (60%; 23-88) of five patients with haematological cancers were seropositive, compared with ten (30%; 17-47) of 33, 18 (86%; 65-95) of 21, and four (11%; 4-25) of 36, respectively, who did not receive a boost. The vaccine was well tolerated; no toxicities were reported in 75 (54%) of 140 patients with cancer following the first dose of BNT162b2, and in 22 (71%) of 31 patients with cancer following the second dose. Similarly, no toxicities were reported in 15 (38%) of 40 healthy controls after the first dose and in five (31%) of 16 after the second dose. Injection-site pain within 7 days following the first dose was the most commonly reported local reaction (23 [35%] of 65 patients with cancer; 12 [48%] of 25 healthy controls). No vaccine-related deaths were reported. INTERPRETATION: In patients with cancer, one dose of the BNT162b2 vaccine yields poor efficacy. Immunogenicity increased significantly in patients with solid cancer within 2 weeks of a vaccine boost at day 21 after the first dose. These data support prioritisation of patients with cancer for an early (day 21) second dose of the BNT162b2 vaccine. FUNDING: King's College London, Cancer Research UK, Wellcome Trust, Rosetrees Trust, and Francis Crick Institute.