Inflammatory response participates in the overall pathophysiological process of stroke. It is a promising strategy to develop antistroke drugs targeting inflammation. This study is aimed at investigating the therapeutic effect and anti-inflammatory mechanism of salvianolic acid D (SalD) against cerebral ischemia/reperfusion (I/R) injury. A rat middle cerebral artery occlusion/reperfusion (MCAO/R) injury model was established, and an oxygen-glucose deprivation/reoxygenation (OGD/R) injury model was established in PC12 cells. Neurological deficit score, cerebral infarction, and edema were studied in vivo. Cell viability was achieved using the MTT method in vitro. The Bax, Bcl-2, cytochrome c, HMGB1, TLR4, TRAF6, NF-κB p65, p-NF-κB p65, and cleaved caspase-3 and -9 were tested via the Western blot method. Cytokines and cytokine mRNA, including TNF-α, IL-1β, and IL-6, were studied via ELISA and PCR methods. The translocation of HMGB1 and NF-κB were studied by immunofluorescence assay. The HMGB1/NeuN, HMGB1/GFAP, and HMGB1/Iba1 double staining was carried out to observe the localization of HMGB1 in different cells. Results showed that SalD alleviated neurological impairment, decreased cerebral infarction, and reduced edema in I/R rats. SalD improved OGD/R-downregulated PC12 cell viability. SalD also promoted Bcl-2 expression and suppressed Bax, cytochrome c, and cleaved caspase-3 and -9 expression. SalD decreased the intensity of TLR4, MyD88, and TRAF6 proteins both in vivo and in vitro, and significantly inhibited the NF-κB nuclear translocation induced by I/R and OGD/R. What’s more, SalD inhibited HMGB1 cytoplasmic translocation in neurons, astrocytes, and microglia in both the cortex and hippocampus regions of I/R rats. In conclusion, SalD can alleviate I/R-induced cerebral injury in rats and increase the PC12 cell viability affected by OGD/R. The anti-inflammatory mechanism of SalD might result from the decreased nuclear-to-cytoplasmic translocation of HMGB1 and the inhibition on its downstream TLR4/MyD88/NF-κB signaling.