Severe acute respiratory syndrome coronavirus 2 (SARS-CoV-2) Omicron sublineages carry distinct spike mutations resulting in escape from antibodies induced by previous infection or vaccination. We show that hybrid immunity or vaccine boosters elicit plasma-neutralizing antibodies against Omicron BA.1, BA.2, BA.2.12.1, and BA.4/5, and that breakthrough infections, but not vaccination alone, induce neutralizing antibodies in the nasal mucosa. Consistent with immunological imprinting, most antibodies derived from memory B cells or plasma cells of Omicron breakthrough cases cross-react with the Wuhan-Hu-1, BA.1, BA.2, and BA.4/5 receptor-binding domains, whereas Omicron primary infections elicit B cells of narrow specificity up to 6 months after infection. Although most clinical antibodies have reduced neutralization of Omicron, we identified an ultrapotent pan-variant-neutralizing antibody that is a strong candidate for clinical development.