Exercise induces beneficial responses in the brain, which is accompanied by an increase in BDNF, a trophic factor associated with cognitive improvement and the alleviation of depression and anxiety. However, the exact mechanisms whereby physical exercise produces an induction in brain Bdnf gene expression are not well understood. While pharmacological doses of HDAC inhibitors exert positive effects on Bdnf gene transcription, the inhibitors represent small molecules that do not occur in vivo. Here, we report that an endogenous molecule released after exercise is capable of inducing key promoters of the Mus musculus Bdnf gene. The metabolite β-hydroxybutyrate, which increases after prolonged exercise, induces the activities of Bdnf promoters, particularly promoter I, which is activity-dependent. We have discovered that the action of β-hydroxybutyrate is specifically upon HDAC2 and HDAC3, which act upon selective Bdnf promoters. Moreover, the effects upon hippocampal Bdnf expression were observed after direct ventricular application of β-hydroxybutyrate. Electrophysiological measurements indicate that β-hydroxybutyrate causes an increase in neurotransmitter release, which is dependent upon the TrkB receptor. These results reveal an endogenous mechanism to explain how physical exercise leads to the induction of BDNF.