Microglia are CNS-resident macrophages and play important roles in neural development and function. However, how microglial precursors born in peripheral tissues colonize the CNS remains undefined. Using in vivo imaging and genetic manipulation of zebrafish, we showed that microglial precursors enter the optic tectum of the midbrain, where the majority of microglia reside during early development, via the lateral periphery between the eyes and brain and the ventral periphery of the brain in a circulation-independent manner. The colonization of the optic tectum by microglial precursors is dynamic and driven by apoptotic neuronal death, which occurs naturally in the midbrain during neurogenesis. We further show that lysophosphatidylcholine, a phospholipid known to be released from apoptotic cells, can promote microglial precursor entry into the brain via its cognate receptors grp132b. Our study reveals that microglia colonization of developing zebrafish midbrain is triggered by apoptotic neuronal death, possibly via releasing lysophosphatidylcholine.