O-linked N-acetylglucosamine (O-GlcNAc) transferase (Ogt) catalyzes O-GlcNAc modification. O-GlcNAcylation is increased after cross-linking of the B-cell receptor (BCR), but the physiological function of this reaction is unknown. Here we show that lack of Ogt in B-cell development not only causes severe defects in the activation of BCR signaling, but also perturbs B-cell homeostasis by enhancing apoptosis of mature B cells, partly as a result of impaired response to B-cell activating factor. O-GlcNAcylation of Lyn at serine 19 is crucial for efficient Lyn activation and Syk interaction in BCR-mediated B-cell activation and expansion. Ogt deficiency in germinal center (GC) B cells also results in enhanced apoptosis of GC B cells and memory B cells in an immune response, consequently causing a reduction of antibody levels. Together, these results demonstrate that B cells rely on O-GlcNAcylation to maintain homeostasis, transduce BCR-mediated activation signals and activate humoral immunity.