Microglia, the brain-resident immune cells, are critically involved in many physiological and pathological brain processes, including neurodegeneration. Here we characterize microglia morphology and transcriptional programs across ten species spanning more than 450 million years of evolution. We find that microglia express a conserved core gene program of orthologous genes from rodents to humans, including ligands and receptors associated with interactions between glia and neurons. In most species, microglia show a single dominant transcriptional state, whereas human microglia display significant heterogeneity. In addition, we observed notable differences in several gene modules of rodents compared with primate microglia, including complement, phagocytic, and susceptibility genes to neurodegeneration, such as Alzheimer's and Parkinson's disease. Our study provides an essential resource of conserved and divergent microglia pathways across evolution, with important implications for future development of microglia-based therapies in humans.