Ribosome-synthesized post-translationally modified peptides (RiPPs) represent a rapidly expanding class of natural products with various biological activities. Linear azol(in)e-containing peptides (LAPs) comprise a subclass of RiPPs that display outstanding diversity of mechanisms of action while sharing common structural features. Here, we report the discovery of a new LAP biosynthetic gene cluster in the genome of Rhizobium Pop5, which encodes the precursor peptide and modification machinery of phazolicin (PHZ) – an extensively modified peptide exhibiting narrow-spectrum antibacterial activity against some symbiotic bacteria of leguminous plants. The cryo-EM structure of the Escherichia coli 70S-PHZ complex reveals that the drug interacts with the 23S rRNA and uL4/uL22 proteins and obstructs ribosomal exit tunnel in a way that is distinct from other compounds. We show that the uL4 loop sequence determines the species-specificity of antibiotic action. PHZ expands the known diversity of LAPs and may be used in the future as biocontrol agent for agricultural needs.