Microglia are resident immune cells of the central nervous system. They can be directly isolated from the brain or from mixed postnatal glial cultures. Isolation of primary microglia is inefficient due to low yield. The cell line BV2 was used as a substitute for primary microglia, but BV2 are oncogenically transformed cells. Here, we established a protocol to generate microglial precursor lines from mouse embryonic stem (ES) cells. Microglial precursor cells were obtained from murine ES cells by differentiation of embryoid bodies to microglia within a mixed brain culture. Several independent ES cell-derived microglial precursor (ESdM) lines were generated and characterized by flow cytometry, immunocytochemistry, and functional assays. All ESdM showed expression of IBa1, CD11b, CD45, F4/80, CD49d, and CD29, but were negative for cKit and CD34. Stimulation with interferon-gamma or lipopolysaccharide (LPS) demonstrated upregulation of proinflammatory cytokine gene transcription including nitric oxide synthase-2, interleukin-1beta, and tumor necrosis factor-alpha at levels comparable to primary microglia. The ESdM showed efficient and rapid phagocytosis of microsphere beads, which was increased after stimulation with LPS. ESdM expressed the chemokine receptor CX3CR1 and demonstrated directed migration toward the ligand CX3CL1. After in vivo transplantation into postnatal brain tissue, ESdM showed engraftment as cells with a microglial phenotype and morphology. Thus, ESdM are stable proliferating cells substantially having most characteristics of primary microglia and therefore being a suitable tool to study microglial function in vitro and in vivo.