Mechanical allodynia, which develops in patients of diabetes mellitus as a neuropathic manifestation, remains without an effective treatment. The aim of the present study was to investigate the effects and potential mechanisms underlying resveratrol (RES) in a rat model of streptozocin (STZ)‑induced diabetic mechanical allodynia (DMA). The rat model of DMA was established by the administration of an intraperitoneal injection of STZ. From day 8 post‑STZ injection, rats were administered with an intragastric injection of various doses of RES for 14 consecutive days. The von Frey filaments were applied to detect the paw withdrawal threshold and evaluate the analgesic effects of RES. Based on the dose‑effect curve, the ED50 of RES was calculated. Immunofluorescence staining and western blotting were performed to detect the expression of purinergic receptor P2X3 (P2X3R) in the dorsal root ganglion (DRG) and spinal dorsal horn (SDH) following RESED50 treatment. The results indicated that RES significantly alleviated mechanical allodynia in DMA model rats in a dose‑dependent manner. Compared with the control group, the expression of P2X3R in DRG neurons and SDH terminals was markedly decreased following the administration of RESED50 (P<0.05). Collectively, the results indicated that RES displayed a dose‑dependent analgesic effect on DMA model rats. Furthermore, P2X3R expression downregulation in the DRG and SDH may be a mechanism underlying the analgesic effects of RES on DMA‑related behaviors.