Many surface proteins are thought to be anchored to the cell wall of Gram-positive bacteria via their C-terminus. Cell wall anchoring requires a specific sorting signal, normally located at the predicted C-terminus of surface proteins. Here we show that when placed into the middle of a polypeptide chain, the sorting signal causes the specific cleavage of the precursor as well as the cell wall anchoring of its N-terminal fragment, while the C-terminal fragment remains within the cytoplasm. N-terminal sequencing of the C-terminal cleavage fragment suggests that the cleavage site is located between threonine (T) and glycine (G) of the LPXTG motif, the signature sequence of cell wall sorting signals. All surface proteins harbouring an LPXTG sequence motif may therefore be cleaved and anchored by a universal mechanism. We also propose a novel hypothesis for the cell wall linkage of surface proteins in Gram-positive bacteria.