Endolysin is a peptidoglycan hydrolase encoded in a phage genome. The enzyme is attractive due to its potential use as antibacterial treatment. ABSTRACT Endolysin is a phage-encoded cell-wall hydrolase which degrades the peptidoglycan layer of the bacterial cell wall. The enzyme is often expressed at the late stage of the phage lytic cycle and is required for progeny escape. Endolysins of bacteriophage that infect Gram-positive bacteria often comprises two domains: a peptidoglycan hydrolase and a cell-wall binding domain (CBD). Although the catalytic domain of endolysin is relatively well-studied, the precise role of CBD is ambiguous and remains controversial. Here, we focus on the function of endolysin CBD from a recently isolated Clostridioides difficile phage. We found that the CBD is not required for lytic activity, which is strongly prevented by the surface layer of C. difficile. Intriguingly, hidden Markov model analysis suggested that the endolysin CBD is likely derived from the CWB2 motif of C. difficile cell-wall proteins but possesses a higher binding affinity to bacterial cell-wall polysaccharides. Moreover, the CBD forms a homodimer, formation of which is necessary for interaction with the surface saccharides. Importantly, endolysin diffusion and sequential cytolytic assays showed that CBD of endolysin is required for the enzyme to be anchored to post-lytic cell-wall remnants, suggesting its physiological roles in limiting diffusion of the enzyme, preserving neighboring host cells, and thereby enabling the phage progeny to initiate new rounds of infection. Taken together, this study provides an insight into regulation of endolysin through CBD and can potentially be applied for endolysin treatment against C. difficile infection. IMPORTANCE Endolysin is a peptidoglycan hydrolase encoded in a phage genome. The enzyme is attractive due to its potential use as antibacterial treatment. To utilize endolysin for the therapeutic propose, understanding of the fundamental role of endolysin becomes important. Here, we investigate the function of cell-wall binding domain (CBD) of an endolysin from a C. difficile phage. The domain is homologous to a cell-wall associating module of bacterial cell-wall proteins, likely acquired during phage-host coevolution. The interaction of CBD to bacterial cell walls reduces enzyme diffusion and thereby limits cell lysis of the neighboring bacteria. Our findings indicate that the endolysin is trapped to the cell-wall residuals through CBD and might serve as an advantage for phage replication. Thus, employing a CBD-less endolysin might be a feasible strategy for using endolysin for the treatment of C. difficile infection.