Aberrant microglial responses contribute to neuroinflammation in many neurodegenerative diseases, but no current therapies target pathogenic microglia. We discovered unexpectedly that the antiviral drug ganciclovir (GCV) inhibits the proliferation of microglia in experimental autoimmune encephalomyelitis (EAE), a mouse model for multiple sclerosis (MS), as well as in kainic acid-induced excitotoxicity. In EAE, GCV largely prevented infiltration of T lymphocytes into the central nervous system (CNS) and drastically reduced disease incidence and severity when delivered before the onset of disease. In contrast, GCV treatment had minimal effects on peripheral leukocyte distribution in EAE and did not inhibit generation of antibodies after immunization with ovalbumin. Additionally, a radiolabeled analogue of penciclovir, [(18)F]FHBG, which is similar in structure to GCV, was retained in areas of CNS inflammation in EAE, but not in naive control mice, consistent with the observed therapeutic effects. Our experiments suggest GCV may have beneficial effects in the CNS beyond its antiviral properties.