Aims: The causes of distinct patterns of reduced cortical thickness in the common human epilepsies, detectable on neuroimaging and with important clinical consequences, are unknown. We investigated the underlying mechanisms of cortical thinning using a systems-level analysis. Methods: Imaging-based cortical structural maps from a large-scale epilepsy neuroimaging study were overlaid with highly spatially resolved human brain gene expression data from the Allen Human Brain Atlas. Cell-type deconvolution, differential expression analysis and cell-type enrichment analyses were used to identify differences in cell-type distribution. These differences were followed up in post-mortem brain tissue from humans with epilepsy using Iba1 immunolabelling. Furthermore, to investigate a causal effect in cortical thinning, cell-type-specific depletion was used in a murine model of acquired epilepsy. Results: We identified elevated fractions of microglia and endothelial cells in regions of reduced cortical thickness. Differentially expressed genes showed enrichment for microglial markers and, in particular, activated microglial states. Analysis of post-mortem brain tissue from humans with epilepsy confirmed excess activated microglia. In the murine model, transient depletion of activated microglia during the early phase of the disease development prevented cortical thinning and neuronal cell loss in the temporal cortex. Although the development of chronic seizures was unaffected, the epileptic mice with early depletion of activated microglia did not develop deficits in a non-spatial memory test seen in epileptic mice not depleted of microglia. Conclusions: These convergent data strongly implicate activated microglia in cortical thinning, representing a new dimension for concern and disease modification in the epilepsies, potentially distinct from seizure control.