Innate immune memory is a vital mechanism of myeloid cell plasticity that occurs in response to environmental stimuli and alters subsequent immune responses. Two types of immunological imprinting can be distinguished-training and tolerance. These are epigenetically mediated and enhance or suppress subsequent inflammation, respectively. Whether immune memory occurs in tissue-resident macrophages in vivo and how it may affect pathology remains largely unknown. Here we demonstrate that peripherally applied inflammatory stimuli induce acute immune training and tolerance in the brain and lead to differential epigenetic reprogramming of brain-resident macrophages (microglia) that persists for at least six months. Strikingly, in a mouse model of Alzheimer's pathology, immune training exacerbates cerebral β-amyloidosis and immune tolerance alleviates it; similarly, peripheral immune stimulation modifies pathological features after stroke. Our results identify immune memory in the brain as an important modifier of neuropathology.