Background: In epileptic patients and humans treated with antiepileptic drugs, androgen concentration is significantly reduced, leading to an increase in seizures, followed by the destruction of hippocampal neurons and memory and learning disorders. Objectives: This study aims to examine the effect of icariin extract on epileptic rats following gonadectomy. Methods: A total of 84 male mice were used. Mice were randomly divided into 12 groups: Control, pentylenetetrazole (PTZ), dimethyl sulfoxide (DMSO), icariin (E), gonadectomy (GO), PTZ+E, PTZ+GO, DMSO+E, DMSO+GO, E+GO, PTZ+E+GO and DMSO+E+GO. After inducing epilepsy using PTZ, the shuttle box test and tissue parameters were evaluated. Results: This study showed that both epilepsy-induced seizures and gonadectomy decreased neuronal density in the hippocampus, decreased Nestin expression, increased degenerated cells and inflammation, increased the number of monocytes and decreased memory and learning ability. The icariin extract improved this condition to a certain extent. Conclusion: The use of herbal medicines, such as icariin, in the treatment of epilepsy by increasing testosterone levels and its neuroprotective properties may open up new horizons in the treatment of patients with epilepsy.