Objective To investigate the role of transient receptor potential melatonin 2 (TRPM2) ion channels in microglia and astrocytes in temporal lobe epilepsy (TLE) -associated neuroinflammation. Methods Rats were randomly divided into the control group and epilepsy group. Seizure models were induced by lithium chloride-pilocarpine in the epilepsy group, and those in the control group were injected with the same dose of saline. The TLE rats were randomly divided into 7 subgroups according to the observation time after model establishment: acute phase (3 h group, 6 h group, 1 d group, 2 d group), latent phase (14 d group) and chronic phase (30 d group, 90 d group) subgroups (n = 5). The expression level of TRPM2 in the hippocampus of TLE rats at different stages were detected, and the cellular localization of TRPM2 in the brain of TLE rats was investigated. BV2 and C8 cell lines were induced by hydrogen peroxide (H2O2). The levels of IL1-β, IL-6 and TNF-α released by BV2 and C8 cells were observed by ELISA. The levels of TRPM2, poly (ADP-ribose) polymerase 1 (PARP-1), glycogen synthase kinase-3β (GSK-3β) and phosphorylated nuclear factor-κb p65 (p-NF-κb p65) were measured in H2O2-induced BV2 and C8 cells. Meantime, the activity of Calcineurin (CaN) in H2O2-induced BV2 was observed. Results The TRPM2 expression in 2d epileptic rat hippocampus was increased (P < 0.05). The expression of TRPM2 and the release of inflammatory cytokines were increased in H2O2 induced-BV2 and C8 cells (both P < 0.05). H2O2 could up-regulate the expression of PARP-1 and p-NF-κB p65 and enhance the activity of CaN in BV2 cells (all P < 0.05). Conclusions Oxidative stress can up-regulate the expression levels of TRPM2 and pro-inflammatory cytokines in microglia and astrocytes. Oxidative stress caused by recurrent epilepsy may mediate the occurrence of TLE-associated neuroinflammation through the TRPM2/ CaN/p-NF-κB p65 pathway in microglia