Magnesium (Mg2+) has been shown to exert neuroprotective effects against hypoxia. However, it still remains elusive whether Mg2+ protected mouse hippocampal HT22 cells against hypoxia‐evoked damages. Therefore, we aimed to investigate the function of Mg2+ and mechanisms associated with microRNA‐221 (miR‐221). HT22 cells were exposed to 3% O2 for 24 hours to induce hypoxic damages with 21% as a normoxic culture condition. The damages were monitored by viability, migration, and apoptosis of HT22 cells with or without Mg2+ pretreatment. Quantitative reverse transcription‐polymerase chain reaction (qRT‐PCR) was applied to examine the alteration of miR‐221, miR‐210, and miR‐17‐5p. Transduction was carried out to artificially alter the expression of miR‐221 and nerve growth factor (NGF), which was confirmed by qRT‐PCR or Western blot assays. To blunt phosphoinositide 3‐kinase (PI3K)/protein kinase B (AKT) and nuclear factor κB (NF‐κB), LY294002 (10 µM) and BAY 11‐7082 (10 µM) were used. We observed Mg2+ protected HT22 cells against hypoxia‐induced damages by upregulating miR‐221. Further, miR‐221 positively regulated NGF expression. Overexpression of NGF alleviated cell injury, while suppression of NGF aggravated cell injury. Moreover, miR‐221 elevated NGF by inducing phosphorylation of regulators in PI3K/AKT and NF‐κB transduction cascades and then alleviated cell injury. In conclusion, Mg2+ protected HT22 cells against hypoxia‐induced damages by upregulation of miR‐221 and NGF. These findings provided insights into the development of improved strategies for clinical application.