Resveratrol (Res) or trans-3,4',5-trihydroxystilbene, has been proven to exert neuroprotective effects in cerebral ischemia. The aim of the present study was to investigate whether Res has neuroprotective effects in primary cortical neurons subjected to transient oxygen-glucose deprivation (OGD) via inhibiting the expression of the gene encoding stromelysin-1, also known as matrix metalloproteinase-3 (MMP-3), and via inhibiting cell apoptosis. Primary cortical cells were exposed to OGD, followed by reoxygenation to induce transient ischemia. Res (50 µM) was added into the culture medium during transient ischemia in the presence or absence of the nuclear factor (NF)-κB inhibitor pyrrolidine dithiocarbamate (PDTC; 10 µM) or 500 µM of the nitric oxide (NO) donor NOC-18. Cell viability was assessed using the tetrazolium reduction (MTT) assay. Cell apoptosis was evaluated by flow cytometry. MMP-3 expression was analyzed by western blot and reverse transcription-polymerase chain reaction (RT-PCR), while the levels of inducible NO synthase (iNOS), NF-κB, caspase-3, cleaved caspase-3, B-cell lymphoma 2 (Bcl-2) and Bcl-2-associated X protein (Bax) were assayed by western blot. NO was detected using a spectrophotometric method. We found that the cellular viability was significantly reduced by transient OGD and that this effect was reversed by Res treatment. In addition, OGD was shown to induce cell apoptosis, the expression of Bax and the activation of caspase-3, and inhibit the expression of Bcl-2, and these effects were also reversed by Res treatment. Res treatment significantly reduced the level of MMP-3 that was induced by transient OGD, via inhibition of NF-κB expression. In addition, Res inhibited iNOS expression and NO synthesis that were induced by OGD. MMP-3 expression induced by NO was attenuated by Res treatment and was partially restored by exogenous NO using NOC-18. Taken together, these findings indicate that OGD induces apoptosis through canonical apoptosis signaling and by modulating the expression of MMP-3; Res can reverse the OGD-induced MMP-3 expression and cell apoptosis via the NF-κB-iNOS/NO pathway. Therefore, Res may be a promising agent for the treatment of neuronal injury associated with stroke.