The innate immune system is increasingly appreciated to play an important role in the mediation of chronic pain, and one molecule implicated in this process is the Toll-like receptor 4 (TLR4). Here, using pharmacological and genetic manipulations, we found that activating TLR4 in the spinal cord, with the agonist lipopolysaccharide (LPS), causes robust mechanical allodynia but only in male mice. Spinal LPS had no pain-producing effect in female mice. TLR4 also has a sex-specific role in inflammatory (complete Freund's adjuvant) and neuropathic (spared nerve injury) pain: pain behaviors were TLR4 dependent in males but TLR4 independent in females. The sex differences appear to be specific to the spinal cord, as LPS administered to the brain or the hindpaw produces equivalent allodynia in both sexes, and specific to pain, as intrathecal LPS produces equivalent hypothermia in both sexes. The involvement of TLR4 in pain behaviors in male mice is dependent on testosterone, as shown by gonadectomy and hormone replacement. We found no sex differences in spinal Tlr4 gene expression at baseline or after LPS, suggesting the existence of parallel spinal pain-processing circuitry in female mice not involving TLR4.