Microglia transform in response to changes in sensory or neural activity, such as sensory deprivation. However, little is known about how specific frequencies of neural activity, or brain rhythms, affect microglia and cytokine signaling. Using visual noninvasive flickering sensory stimulation (flicker) to induce electrical neural activity at 40 hertz, within the gamma band, and 20 hertz, within the beta band, we found that these brain rhythms differentially affect microglial morphology and cytokine expression in healthy animals. Flicker induced expression of certain cytokines independently of microglia, including interleukin-10 and macrophage colony-stimulating factor. We hypothesized that nuclear factor κB (NF-κB) plays a causal role in frequency-specific cytokine and microglial responses because this pathway is activated by synaptic activity and regulates cytokines. After flicker, phospho-NF-κB colabeled with neurons more than microglia. Inhibition of NF-κB signaling down-regulated flicker-induced cytokine expression and attenuated flicker-induced changes in microglial morphology. These results reveal a mechanism through which brain rhythms affect brain function by altering microglial morphology and cytokines via NF-κB.