Phosphate concentration is tightly regulated at the cellular and organismal levels. The first metazoan phosphate exporter, XPR1, was recently identified, but its in vivo function remains unknown. In a genetic screen, we identified a mutation in a zebrafish ortholog of human XPR1, xpr1b. xpr1b mutants lack microglia, the specialized macrophages that reside in the brain, and also displayed an osteopetrotic phenotype characteristic of defects in osteoclast function. Transgenic expression studies indicated that xpr1b acts autonomously in developing macrophages. xpr1b mutants display no gross developmental defects that may arise from phosphate imbalance. We constructed a targeted mutation of xpr1a, a duplicate of xpr1b in the zebrafish genome, to determine whether Xpr1a and Xpr1b have redundant functions. Single mutants for xpr1a were viable, and double mutants for xpr1b;xpr1a were similar to xpr1b single mutants. Our genetic analysis reveals a specific role for the phosphate exporter Xpr1 in the differentiation of tissue macrophages.