Klebsazolicin (KLB) is a recently discovered Klebsiella pneumonia peptide antibiotic targeting the exit tunnel of bacterial ribosome. KLB contains an N-terminal amidine ring and four azole heterocycles installed into a ribosomally synthesized precursor by dedicated maturation machinery. Using an in vitro system for KLB production, we show that the YcaO-domain KlpD maturation enzyme is a bifunctional cyclodehydratase required for the formation of both the core heterocycles and the N-terminal amidine ring. We further demonstrate that the amidine ring is formed concomitantly with proteolytic cleavage of azole-containing pro-KLB by a cellular protease TldD/E. Members of the YcaO family are diverse enzymes known to activate peptide carbonyls during natural product biosynthesis leading to the formation of azoline, macroamidine, and thioamide moieties. The ability of KlpD to simultaneously perform two distinct types of modifications is unprecedented for known YcaO proteins. The versatility of KlpD opens up possibilities for rational introduction of modifications into various peptide backbones.