D29 mycobacteriophage encodes LysA endolysin, which mediates mycobacterial host cell lysis by targeting its peptidoglycan layer, thus projecting itself as a potential therapeutic. However, the regulatory mechanism of LysA during the phage lytic cycle remains ill defined. Here, we show that during D29 lytic cycle, structural and functional regulation of LysA not only orchestrates host cell lysis but also is critical for maintaining phage-host population dynamics by governing various phases of lytic cycle. We report that LysA exists in two conformations, of which only one is active, and the protein undergoes a host peptidoglycan–dependent conformational switch to become active for carrying out endogenous host cell lysis. D29 maintains a pool of inactive LysA, allowing complete assembly of phage progeny, thus helping avoid premature host lysis. In addition, we show that the switch reverses after lysis, thus preventing exogenous targeting of bystanders, which otherwise negatively affects phage propagation in the environment.