The ketone body β-hydroxybutyrate (BHB) is an endogenous factor protecting against stroke and neurodegenerative diseases, but its mode of action is unclear. Here we show in a stroke model that the hydroxy-carboxylic acid receptor 2 (HCA2, GPR109A) is required for the neuroprotective effect of BHB and a ketogenic diet, as this effect is lost in Hca2(-/-) mice. We further demonstrate that nicotinic acid, a clinically used HCA2 agonist, reduces infarct size via a HCA2-mediated mechanism, and that noninflammatory Ly-6C(Lo) monocytes and/or macrophages infiltrating the ischemic brain also express HCA2. Using cell ablation and chimeric mice, we demonstrate that HCA2 on monocytes and/or macrophages is required for the protective effect of nicotinic acid. The activation of HCA2 induces a neuroprotective phenotype of monocytes and/or macrophages that depends on PGD2 production by COX1 and the haematopoietic PGD2 synthase. Our data suggest that HCA2 activation by dietary or pharmacological means instructs Ly-6C(Lo) monocytes and/or macrophages to deliver a neuroprotective signal to the brain.