EBI2 (also called GPR183) is an orphan G-protein-coupled receptor that is highly expressed in spleen and upregulated upon Epstein-Barr-virus infection. Recent studies indicated that this receptor controls follicular B-cell migration and T-cell-dependent antibody production. Oxysterols elicit profound effects on immune and inflammatory responses as well as on cholesterol metabolism. The biological effects of oxysterols have largely been credited to the activation of nuclear hormone receptors. Here we isolate oxysterols from porcine spleen extracts and show that they are endogenous ligands for EBI2. The most potent ligand and activator is 7α,25-dihydroxycholesterol (OHC), with a dissociation constant of 450 pM for EBI2. In vitro, 7α,25-OHC stimulated the migration of EBI2-expressing mouse B and T cells with half-maximum effective concentration values around 500 pM, but had no effect on EBI2-deficient cells. In vivo, EBI2-deficient B cells or normal B cells desensitized by 7α,25-OHC pre-treatment showed reduced homing to follicular areas of the spleen. Blocking the synthesis of 7α,25-OHC in vivo with clotrimazole, a CYP7B1 inhibitor, reduced the content of 7α,25-OHC in the mouse spleen and promoted the migration of adoptively transferred pre-activated B cells to the T/B boundary (the boundary between the T-zone and B-zone in the spleen follicle), mimicking the phenotype of pre-activated B cells from EBI2-deficient mice. Our results show an unexpected causal link between EBI2, an orphan G-protein-coupled receptor controlling B-cell migration, and the known immunological effects of certain oxysterols, thus uncovering a previously unknown role for this class of molecules.