Inactivated COVID-19 vaccines data in immunocompromised individuals are scarce. This trial assessed the immunogenicity of two CoronaVac doses and additional BNT162b2 mRNA vaccine doses in immunocompromised (IC) and immunocompetent (H) individuals. Adults with solid organ transplant (SOT), hematopoietic stem cell transplant, cancer, inborn immunity errors or rheumatic diseases were included in the IC group. Immunocompetent adults were used as control group for comparison. Participants received two CoronaVac doses within a 28-day interval. IC received two additional BNT162b2 doses and H received a third BNT162b2 dose (booster). Blood samples were collected at baseline, 28 days after each dose, pre-booster and at the trial end. We used three serological tests to detect antibodies to SARS-CoV-2 nucleocapsid (N), trimeric spike (S), and receptor binding domain (RBD). Outcomes included seroconversion rates (SCR), geometric mean titers (GMT) and GMT ratio (GMTR). A total of 241 IC and 100 H adults participated in the study. After two CoronaVac doses, IC had lower SCR than H: anti-N, 33.3% vs 79%; anti-S, 33.8% vs 86%, and anti-RBD, 48.5% vs 85%, respectively. IC also showed lower GMT than H: anti-N, 2.3 vs 15.1; anti-S, 58.8 vs 213.2 BAU/mL; and anti-RBD, 22.4 vs 168.0 U/mL, respectively. After the 3rd and 4th BNT162b2 doses, IC had significant anti-S and anti-RBD seroconversion, but still lower than H after the 3rd dose. After boosting, GMT increased in IC, but remained lower than in the H group. CoronaVac two-dose schedule immunogenicity was lower in IC than in H. BNT162b2 heterologous booster enhanced immune response in both groups.