Metazoan cell death mechanisms are diverse and include numerous non-apoptotic programs. One program called entosis involves the invasion of live cells into their neighbors and is known to occur in cancers. Here, we identify a developmental function for entosis: to clear the male-specific linker cell in C. elegans. The linker cell leads migration to shape the gonad and is removed to facilitate fusion of the gonad to the cloaca. We find that the linker cell is cleared in a manner involving cell-cell adhesions and cell-autonomous control of uptake through linker cell actin. Linker cell entosis generates a lobe structure that is deposited at the site of gonad-to-cloaca fusion and is removed during mating. Inhibition of lobe scission inhibits linker cell death, demonstrating that the linker cell invades its host while alive. Our findings demonstrate a developmental function for entosis: to eliminate a migrating cell and facilitate gonad-to-cloaca fusion, which is required for fertility.