A previous bioinformatics-based search for riboswitches yielded several candidate motifs in eubacteria. One of these motifs commonly resides in the 5' untranslated regions of genes involved in the biosynthesis of queuosine (Q), a hypermodified nucleoside occupying the anticodon wobble position of certain transfer RNAs. Here we show that this structured RNA is part of a riboswitch selective for 7-aminomethyl-7-deazaguanine (preQ(1)), an intermediate in queuosine biosynthesis. Compared with other natural metabolite-binding RNAs, the preQ(1) aptamer appears to have a simple structure, consisting of a single stem-loop and a short tail sequence that together are formed from as few as 34 nucleotides. Despite its small size, this aptamer is highly selective for its cognate ligand in vitro and has an affinity for preQ(1) in the low nanomolar range. Relatively compact RNA structures can therefore serve effectively as metabolite receptors to regulate gene expression.