Excitatory toxicity due to excessive glutamate release is considered the core pathophysiological mechanism of cerebral ischemia. It is primarily mediated by N-methyl-D-aspartate receptors (NMDARs) on neuronal membranes. Our previous studies have found that icaritin (ICT) exhibits neuroprotective effects against cerebral ischemia in rats, but the underlying mechanism is unclear. This study aims to investigate the protective effect of ICT on glutamate-induced neuronal injury and uncover its possible molecular mechanism. An excitatory toxicity injury model was created using rat primary cortical neurons treated with glutamate and glycine. The results showed that ICT has neuroprotective effects on glutamate-treated primary cortical neurons by increasing cell viability while reducing the rate of lactate dehydrogenase (LDH) release and reducing apoptosis. Remarkably, ICT rescued the changes in the ERK/DAPK1 signaling pathway after glutamate treatment by increasing the expression levels of p-ERK, p-DAPK1 and t-DAPK1. In addition, ICT also regulates NMDAR function during glutamate-induced injury by decreasing the expression level of the GluN2B subunit and enhancing the expression level of the GluN2A subunit. As cotreatment with the ERK-specific inhibitor U0126 and ICT abolishes the beneficial effects of ITC on the ERK/DAPK1 pathway, NMDAR subtypes and neuronal cell survival, ERK is recognized as a crucial mediator in the protective mechanism of ICT. In conclusion, our findings demonstrate that ICT has a neuroprotective effect on neuronal damage induced by glutamate, and its mechanism may be related to inactivating GluN2B-containing NMDAR through the ERK/DAPK1 pathway. This study provides a new clue for the prevention and treatment of clinical ischemic cerebrovascular diseases.