As the resident macrophages of the brain and spinal cord, microglia are crucial for the phagocytosis of infectious agents, apoptotic cells and synapses. During brain injury or infection, bone-marrow derived macrophages invade neural tissue, making it difficult to distinguish between invading macrophages and resident microglia. In addition to circulation-derived monocytes, other non-microglial central nervous system (CNS) macrophage subtypes include border-associated meningeal, perivascular and choroid plexus macrophages. Using immunofluorescent labeling, flow cytometry and Cre-dependent ribosomal immunoprecipitations, we describe P2ry12-CreER, a new tool for the genetic targeting of microglia. We use this new tool to track microglia during embryonic development and in the context of ischemic injury and neuroinflammation. Because of the specificity and robustness of microglial recombination with P2ry12-CreER, we believe that this new mouse line will be particularly useful for future studies of microglial function in development and disease.