In humans, excessive gestational weight gain during pregnancy is associated with an increased risk for executive function deficits in the offspring. Our previous work has confirmed this finding in mice, as offspring from dams fed a 60% high fat (HF) diet during breeding, gestation, and lactation demonstrate impulsive-like behavior in the 5 choice serial reaction time task (5CSRTT). Because the prefrontal cortex (PFC), which plays a key role in executive function, undergoes substantial postnatal adolescent pruning and microglia are actively involved in synaptic refinement, we hypothesized that microglia may play a role in mediating changes in brain development after maternal HF diet, with a specific focus on microglial activity during adolescence. Therefore, we treated male and female offspring from HF or control diet (CD) dams with PLX3397-formulated diet (PLX) to ablate microglia during postnatal days 23–45. After PLX removal and microglial repopulation, adult mice underwent testing to evaluate executive function. Adolescent PLX treatment did increase the control male dropout rate in learning the basic FR1 task, but otherwise had a minimal effect on behavior in control offspring. In males, HF offspring learned faster and performed better on a simple operant task (fixed ratio 1) without an effect of PLX. However, in HF offspring this increase in FR1 responding was associated with more impulsive errors in the 5CSRTT while PLX eliminated this association and decreased impulsive errors specifically in HF offspring. This suggests that adolescent PLX treatment improves executive function and particularly impulsive behavior in adult male HF offspring, without an overall effect of perinatal diet. In females, maternal HF diet impaired reversal learning but PLX had no effect on performance. We then measured gene expression in adult male PFC, nucleus accumbens (NAC), and amygdala (AMG), examining targets related to synaptic function, reward, and inflammation. Maternal HF diet increased PFC synaptophysin and AMG psd95 expression. PFC synaptophysin expression was correlated with more impulsive errors in the 5CSRTT in the HF offspring only and PLX treatment eliminated this correlation. These data suggest that adolescent microglia may play a critical role in mediating executive function after perinatal high fat diet in males.