When starved, the Gram-positive bacterium Bacillus subtilis forms durable spores for survival. Sporulation initiates with an asymmetric cell division, creating a large mother cell and a small forespore. Subsequently, the mother cell membrane engulfs the forespore in a phagocytosis-like process. However, the force generation mechanism for forward membrane movement remains unknown. Here, we show that membrane migration is driven by cell wall remodeling at the leading edge of the engulfing membrane, with peptidoglycan synthesis and degradation mediated by penicillin binding proteins in the forespore and a cell wall degradation protein complex in the mother cell. We propose a simple model for engulfment in which the junction between the septum and the lateral cell wall moves around the forespore by a mechanism resembling the 'template model'. Hence, we establish a biophysical mechanism for the creation of a force for engulfment based on the coordination between cell wall synthesis and degradation.