Termination of protein synthesis occurs when a translating ribosome encounters one of three universally conserved stop codons: UGA, UAA, or UAG. Release factors recognise stop codons in the ribosomal A site to mediate release of the nascent chain and recycling of the ribosome. Bacteria decode stop codons using two separate release factors with differing specificities for the second and third bases1. By contrast, eukaryotes rely on an evolutionarily unrelated omnipotent release factor (eRF1) to recognise all three stop codons2. The molecular basis of eRF1 discrimination for stop codons over sense codons is not known. Here, we present electron cryo-microscopy (cryo-EM) structures at 3.5 – 3.8 Å resolution of mammalian ribosomal complexes containing eRF1 interacting with each of the three stop codons in the A site. Binding of eRF1 flips nucleotide A1825 of 18S rRNA so that it stacks on the second and third stop codon bases. This configuration pulls the fourth position base into the A site, where it is stabilised by stacking against G626 of 18S rRNA. Thus, eRF1 exploits two rRNA nucleotides also used during tRNA selection to drive mRNA compaction. Stop codons are favoured in this compacted mRNA conformation by a hydrogen-bonding network with essential eRF1 residues that constrains the identity of the bases. These results provide a molecular framework for eukaryotic stop codon recognition and have implications for future studies on the mechanisms of canonical and premature translation termination3,4.