Recent evidence suggests that Nod-like receptor protein-3 (NLRP3) inflammasome is a key mediator of inflammatory response and can induce the activation of apoptosis signaling pathways in ischemic stroke. In this research, we assessed the effects of anfibatide (ANF) on inflammatory and apoptosis in cerebral ischemic injury and the potential mechanisms. Middle cerebral artery occlusion (MCAO) model was established on male Sprague-Dawley rats to induce cerebral ischemia/reperfusion (I/R) injury in vivo. Primary cortical neurons (PCN) cells were exposed to oxygen-glucose deprivation and reintroduction (OGD/R) to mimic cerebral I/R injury in vitro. The results showed that ANF markedly alleviated infarct volume, neurological deficit and neurobehavioral impairment in MCAO/R rats, enhanced cell viability and decreased LDH release in PCN after OGD/R. The number of TUNEL-positive cells, Bax, cleaved-caspase-3, p-IκBα, p-p65, NLRP3, ASC, cleaved caspase-1, IL-β and IL-18 proteins expression were significantly upregulated in the cortex of MCAO/R rats and PCN exposed to OGD/R, NLRP3 and caspase-1 mRNA levels were also evidently elevated. Bcl-2 protein expression significantly decreased in the cortex of MCAO/R rats. Treatment with ANF obviously inhibited the expression of p-IκBα, p-p65, NLRP3, ASC, cleaved caspase-1, Bax and cleaved-caspase-3, promoted the expression of Bcl-2, then decreased the TUNEL-positive cell number and the level of inflammatory cytokines (IL-β and IL-18) in cerebral ischemia reperfusion in vito and in vitro. Our findings suggest that ANF exerts effects of alleviating inflammation and apoptosis through inhibiting NF-kappaB/NLRP3 axis. ANF is a potential candidate for treating cerebral I/R injury.