Neuroinflammation in the central nervous system is detrimental for learning and memory, as evident form epidemiological studies linking developmental defects and maternal exposure to harmful pathogens. Postnatal infections can also induce neuroinflammatory responses with long-term consequences. These inflammatory responses can lead to motor deficits and/or behavioral disabilities. Toll like receptors (TLRs) are a family of innate immune receptors best known as sensors of microbial-associated molecular patterns, and are the first responders to infection. TLR2 forms heterodimers with either TLR1 or TLR6, is activated in response to gram-positive bacterial infections, and is expressed in the brain during embryonic development. We hypothesized that early postnatal TLR2-mediated neuroinflammation would adversely affect cognitive behavior in the adult. Our data indicate that postnatal TLR2 activation affects learning and memory in adult mice in a heterodimer-dependent manner. TLR2/6 activation improved motor function and fear learning, while TLR2/1 activation impaired spatial learning and enhanced fear learning. Moreover, developmental TLR2 deficiency significantly impairs spatial learning and enhances fear learning, stressing the involvement of the TLR2 pathway in learning and memory. Analysis of the transcriptional effects of TLR2 activation reveals both common and unique transcriptional programs following heterodimer-specific TLR2 activation. These results imply that adult cognitive behavior could be influenced in part, by activation or alterations in the TLR2 pathway at birth.