AbstractBackgroundMelatonin (MEL), an endogenous hormone, has been widely investigated in neurological diseases. Microglia (MG), a resident immunocyte localizing in central nervous system is reported to play important functions in the animal model of temporal lobe epilepsy (TLE). Some evidence showed that MEL influenced activation of MG, but the detailed model of action that MEL plays in remains uncertain.MethodsIn this study, we established a model of TLE in mice by stereotactic injection of kainic acid (KA). We treated the mice with MEL. Lipopolysaccharide, ROCK2‐knockdown (ROCK‐KD) and ‐overexpression (ROCK‐OE) of lentivirus‐treated cells were used in cell experiments to simulate an in vitro inflammatory model.ResultsThe results of electrophysiological tests showed that MEL reduced frequency and severity of seizure. The results of behavioral tests indicated MEL improved cognition, learning, and memory ability. Histological evidences demonstrated a significant reduction of neuronal death in the hippocampus. In vivo study showed that MEL changed the polarization status of MG from a proinflammatory M1 phenotype to an anti‐inflammatory M2 phenotype by inversely regulating the RhoA/ROCK signaling pathway. In cytological study, we found that MEL had a significant protective effect in LPS‐treated BV‐2 cells and ROCK‐KD cells, while the protective effect of MEL was significantly attenuated in ROCK‐OE cells.ConclusionMEL played an antiepileptic role in the KA‐induced TLE modeling mice both in behavioral and histological levels, and changed MG polarization status by regulating the RhoA/ROCK signaling pathway.