Nascent polypeptides can induce ribosome stalling, regulating downstream genes. Stalling of ErmBL peptide translation in the presence of the macrolide antibiotic erythromycin leads to resistance in Streptococcus sanguis. To reveal this stalling mechanism we obtained 3.6-Å-resolution cryo-EM structures of ErmBL-stalled ribosomes with erythromycin. The nascent peptide adopts an unusual conformation with the C-terminal Asp10 side chain in a previously unseen rotated position. Together with molecular dynamics simulations, the structures indicate that peptide-bond formation is inhibited by displacement of the peptidyl-tRNA A76 ribose from its canonical position, and by non-productive interactions of the A-tRNA Lys11 side chain with the A-site crevice. These two effects combine to perturb peptide-bond formation by increasing the distance between the attacking Lys11 amine and the Asp10 carbonyl carbon. The interplay between drug, peptide and ribosome uncovered here also provides insight into the fundamental mechanism of peptide-bond formation.