Toll-like receptor 7 (TLR7) is a single-stranded RNA (ssRNA) sensor in innate immunity and also responds to guanosine and chemical ligands, such as imidazoquinoline compounds. However, TLR7 activation mechanism by these ligands remain largely unknown. Here, we generated crystal structures of three TLR7 complexes, and found that all formed an activated m-shaped dimer with two ligand-binding sites. The first site conserved in TLR7 and TLR8 was used for small ligand-binding essential for its activation. The second site spatially distinct from that of TLR8 was used for a ssRNA-binding that enhanced the affinity of the first-site ligands. The first site preferentially recognized guanosine and the second site specifically bound to uridine moieties in ssRNA. Our structural, biochemical, and mutagenesis studies indicated that TLR7 is a dual receptor for guanosine and uridine-containing ssRNA. Our findings have important implications for understanding of TLR7 function, as well as for therapeutic manipulation of TLR7 activation.