Microbial and synthetic DNA rich in CpG dinucleotides stimulates Toll-like receptor 9 (TLR9), whereas DNA lacking CpG either is inert or can inhibit TLR9 activation. The molecular mechanisms by which TLR9 becomes activated or is inhibited are not well understood. Here we show that TLR9 bound to stimulatory and inhibitory DNA; however, only stimulatory DNA led to substantial conformational changes in the TLR9 ectodomain. In the steady state, 'inactive' TLR9 homodimers formed in an inactivated conformation. Binding of DNA containing CpG, but not of DNA lacking CpG, to TLR9 dimers resulted in allosteric changes in the TLR9 cytoplasmic signaling domains. In endosomes, conformational changes induced by DNA containing CpG resulted in close apposition of the cytoplasmic signaling domains, a change that is probably required for the recruitment of signaling adaptor molecules. Our results indicate that the formation of TLR9 dimers is not sufficient for its activation but instead that TLR9 activation is regulated by conformational changes induced by DNA containing CpG.