The mevalonate pathway produces cholesterol and nonsterol isoprenoids, such as geranylgeraniol. In the brain, a fraction of cholesterol is metabolized in neurons by the enzyme cholesterol 24-hydroxylase, and this depletion activates the mevalonate pathway. Brains from mice lacking 24-hydroxylase excrete cholesterol more slowly, and the tissue compensates by suppressing the mevalonate pathway. Here we report that this suppression causes a defect in learning. 24-Hydroxylase knockout mice exhibit severe deficiencies in spatial, associative, and motor learning, and in hippocampal long-term potentiation (LTP). Acute treatment of wild-type hippocampal slices with an inhibitor of the mevalonate pathway (a statin) also impairs LTP. The effects of statin treatment and genetic elimination of 24-hydroxylase on LTP are reversed by a 20-min treatment with geranylgeraniol but not by cholesterol. We conclude that cholesterol turnover in brain activates the mevalonate pathway and that a constant production of geranylgeraniol in a small subset of neurons is required for LTP and learning.