BackgroundTemporal lobe epilepsy (TLE) is a common brain disease. However, the pathogenesis of TLE and its relationship with immune infiltration remains unclear. We attempted to identify inflammation-related genes (IRGs) and the immune cell infiltration pattern involved in the pathological process of TLE via bioinformatics analysis.Materials and methodsThe GSE88992 dataset was downloaded from the Gene Expression Omnibus (GEO) database to perform differentially expressed genes screening and weighted gene co-expression network analysis (WGCNA). Subsequently, the functional enrichment analysis was performed to explore the biological function of the differentially expressed IRGs (DEIRGs). The hub genes were further identified by the CytoHubba algorithm and validated by an external dataset (GSE60772). Furthermore, the CIBERSORT algorithm was applied to assess the differential immune cell infiltration between control and TLE groups. Finally, we used the DGIbd database to screen the candidate drugs for TLE.Results34 DEIRGs (33 up-regulated and 1 down-regulated gene) were identified, and they were significantly enriched in inflammation- and immune-related pathways. Subsequently, 4 hub DEIRGs (Ptgs2, Jun, Icam1, Il6) were further identified. Immune cell infiltration analysis revealed that T cells CD4 memory resting, NK cells activated, Monocytes and Dendritic cells activated were involved in the TLE development. Besides, there was a significant correlation between hub DEIRGs and some of the specific immune cells.Conclusion4 hub DEIRGs (Ptgs2, Jun, Icam1, Il6) were associated with the pathogenesis of TLE via regulation of immune cell functions, which provided a novel perspective for the understanding of TLE.