Microglia, the tissue-resident macrophages of the CNS, represent major targets for therapeutic intervention in a wide variety of neurological disorders. Efficient reprogramming protocols to generate microglia-like cells in vitro using patient-derived induced pluripotent stem cells will, however, require a precise understanding of the cellular and molecular events that instruct microglial cell fates. This remains a challenge since the developmental origin of microglia during embryogenesis is controversial. Here, using genetic tracing in zebrafish, we uncover primitive macrophages as the unique source of embryonic microglia. We also demonstrate that this initial population is transient, with primitive microglia later replaced by definitive microglia that persist throughout adulthood. The adult wave originates from cmyb-dependent hematopoietic stem cells. Collectively, our work challenges the prevailing model establishing erythro-myeloid progenitors as the sole and direct microglial precursor and provides further support for the existence of multiple waves of microglia, which originate from distinct hematopoietic precursors.