Peritoneal and pleural resident macrophages in the mouse share common features and in each compartment exist as two distinct subpopulations: F4/80+ macrophages and MHC II+ CD11c+ macrophages. F4/80+ macrophages derive from embryonic precursors, and their maintenance is controlled by Gata6. However, the origin and regulatory factors that maintain MHC II+ macrophages remain unknown. Here, we show that the MHC II+ macrophages arise postnatally from CCR2-dependent precursors that resemble monocytes. Monocytes continuously replenish this subset through adulthood. Gene expression analysis identified distinct surface markers like CD226 and revealed that the transcription factor IRF4 was selectively expressed in these macrophages relative to other organs. Monocytes first entered peritoneal or pleural cavities to become MHC II+ cells that up-regulated CD226 and CD11c later as they continued to mature. In the absence of IRF4 or after administration of oral antibiotics, MHC II+CD226-CD11c- monocyte-derived cells accumulated in peritoneal and pleural cavities, but CD11c+ CD226+ macrophages were lost. Thus, MHC II+ resident peritoneal and pleural macrophages are continuously replenished by blood monocytes recruited to the peritoneal and pleural cavities constitutively, starting after birth, where they require IRF4 and signals likely derived from the microbiome to fully differentiate.