Lipopolysaccharide (LPS) preconditioning provides neuroprotection against subsequent cerebral ischemic injury. Tumor necrosis factor-alpha (TNFalpha) is protective in LPS-induced preconditioning yet exacerbates neuronal injury in ischemia. Here, we define dual roles of TNFalpha in LPS-induced ischemic tolerance in a murine model of stroke and in primary neuronal cultures in vitro, and show that the cytotoxic effects of TNFalpha are attenuated by LPS preconditioning. We show that LPS preconditioning significantly increases circulating levels of TNFalpha before middle cerebral artery occlusion in mice and show that TNFalpha is required to establish subsequent neuroprotection against ischemia, as mice lacking TNFalpha are not protected from ischemic injury by LPS preconditioning. After stroke, LPS preconditioned mice have a significant reduction in the levels of TNFalpha (approximately threefold) and the proximal TNFalpha signaling molecules, neuronal TNF-receptor 1 (TNFR1), and TNFR-associated death domain (TRADD). Soluble TNFR1 (s-TNFR1) levels were significantly increased after stroke in LPS-preconditioned mice (approximately 2.5-fold), which may neutralize the effect of TNFalpha and reduce TNFalpha-mediated injury in ischemia. Importantly, LPS-preconditioned mice show marked resistance to brain injury caused by intracerebral administration of exogenous TNFalpha after stroke. We establish an in vitro model of LPS preconditioning in primary cortical neuronal cultures and show that LPS preconditioning causes significant protection against injurious TNFalpha in the setting of ischemia. Our studies suggest that TNFalpha is a twin-edged sword in the setting of stroke: TNFalpha upregulation is needed to establish LPS-induced tolerance before ischemia, whereas suppression of TNFalpha signaling during ischemia confers neuroprotection after LPS preconditioning.