Endothelial cell injury in vascular arterial walls plays a crucial role in the pathological process of atherosclerosis. Pterostilbene, a stilbenoid chemically related to resveratrol, has anti-inflammatory, anti-apoptosis and antioxidant properties. However, the underlying mechanisms mediated by pterostilbene in regards to endothelial cell injury in vascular arterial walls are not fully understood. The purpose of the present study was to investigate the benefits of pterostilbene in a rat model of atherosclerosis. The possible mechanism of pterostilbene was also analyzed in regards to endothelial cell injury in vascular arterial walls in vitro. A rat model of atherosclerosis was established using endothelial injury of the iliac arteries. CCK-8 assay, TUNEL, immunofluorescence, western blot analysis and hematoxylin and eosin (H&E) staining were used to analyze the role of pterostilbene in the pathological processes of atherosclerosis. In vivo results showed that pterostilbene decreased cholesterol (CHO), high-density lipoprotein cholesterol (HDL-C), total cholesterol (TC), low-density lipoprotein cholesterol (LDL-C) in plasma and attenuated interleukin (IL)-1, tumor necrosis factor (TNF)-α and IL-6 and oxidative stress injury in serum in the experimental animals. Pterostilbene treatment reduced atherogenesis, aortic plaques, macrophage infiltration and apoptosis of vascular arterial walls in the atherosclerosis rat model. In vitro assay demonstrated that pterostilbene administration increased viability of the endothelial cells, attenuated oxidative stress injury and apoptosis of endothelial cells. The results found that pterostilbene regulated endothelial cell apoptosis via the Nrf2-mediated TLR-4/MyD88/NF-κB pathway. In conclusion, data from the present study revealed that pterostilbene protects rats against atherosclerosis by regulation of the Nrf2-mediated TLR-4/MyD88/NF-κB pathway.