Developmental risk factors, such as the exposure to stress or high levels of glucocorticoids (GCs), may contribute to the pathogenesis of anxiety disorders. The immunomodulatory role of GCs and the immunological fingerprint found in animals prenatally exposed to GCs point towards an interplay between the immune and the nervous systems in the etiology of these disorders. Microglia are immune cells of the brain, responsive to GCs and morphologically altered in stress-related disorders. These cells are regulated by adenosine A2A receptors, which are also involved in the pathophysiology of anxiety. We now compare animal behavior and microglia morphology in males and females prenatally exposed to the GC dexamethasone. We report that prenatal exposure to dexamethasone is associated with a gender-specific remodeling of microglial cell processes in the prefrontal cortex: males show a hyper-ramification and increased length whereas females exhibit a decrease in the number and in the length of microglia processes. Microglial cells re-organization responded in a gender-specific manner to the chronic treatment with a selective adenosine A2A receptor antagonist, which was able to ameliorate microglial processes alterations and anxiety behavior in males, but not in females.