Treatment with anti-CD20 antibodies (rituximab) is used in both adults and children to treat various autoimmune and oncological diseases. Rituximab depletes B CD20+ cells and, thereby, antibody response to vaccines. This study aimed to examine the antibody response to mRNA-based COVID-19 vaccines in children aged 5-18 years undergoing rituximab treatment compared to healthy matched children. Between 31 January and 18 July 2022, we conducted a prospective observational study at the Geneva University Hospitals, enrolling children aged 5-18 years under rituximab treatment who had received two mRNA-based SARS-CoV-2 vaccine doses. Controls were healthy volunteers with no significant medical conditions. Exclusion criteria included a recent SARS-CoV-2 infection. Blood samples were collected at day 60 (±30) and day 270 (±90) after the second vaccination. The rituximab-treated group exhibited significantly lower levels of antibodies specific to the anti-receptor binding domain (RBD) of the SARS-CoV-2 spike (S) protein than healthy controls at 60 (±30) days after the second vaccine dose (geometric mean concentration: 868.3 IU/mL in patients and 11,393 IU/mL in controls; p = .008). However, patients with a rituximab-to-vaccine interval shorter than 6 months and with evidence of a past infection (based on positive anti-N antibody levels) had a high level of anti-RBD antibodies. A past infection with SARS-CoV-2 may induce anti-RBD-specific memory B cells that can be re-activated by SARS-CoV-2 vaccination, even after rituximab-induced B-cell depletion. This suggests that it is possible to vaccinate earlier than 6 months after rituximab to develop a good antibody response, especially in the case of past SARS-CoV-2 infection.