As an integral part of the innate immune system of the brain, resident microglia must react rapidly to the onset of brain injury and neurological disease. These dynamic cells then continue to shift their phenotype along a multidimensional continuum with overlapping pro- and anti-inflammatory states, allowing them to adapt to microenvironmental changes during the progression of brain disorders. However, the ability of microglia to shift phenotype through nimble molecular, structural, and functional changes comes at a cost, as the extreme pro-inflammatory states may prevent these professional phagocytes from clearing toxic debris and secreting tissue-repairing neurotrophic factors. Evolution has strongly favored heterogeneity in microglia in both the spatial and temporal dimensions-they can assume diverse roles in different brain regions, throughout the course of brain development and aging, and during the spatiotemporal progression of brain injuries and neurological diseases. Age and sex differences add further diversity to microglia functional status under physiological and pathological conditions. This article reviews recent advances in our knowledge of microglia with emphases on molecular mediators of phenotype shifts and functional diversity. We describe microglia-targeted therapeutic opportunities, including pharmacologic modulation of phenotype and repopulation of the brain with fresh microglia. With the advent of powerful new tools, research on microglia has recently accelerated in pace and may translate into potential therapeutics against brain injury and neurological disease.