Maternal inflammation during pregnancy is associated with a higher incidence of mental disorders (e.g. schizophrenia and autism) in the offspring. In our study, we investigate the involvement of the NRG-ErbB signaling pathway in rodent fetal brains four hours following maternal immune activation (MIA) insult at two different gestational days (i.e. early vs late). Furthermore, we test the long-term behavioral alteration of the exposed MIA mice at juvenile and adulthood. We demonstrate that MIA at late, but not at early gestation day, altered the expression of NRG1, its receptor ErbB4, and the dopamine D2 receptor four hours post injection of viral or bacterial mimic material in fetal brain. At the behavioral levels, adult late-MIA-exposed female offspring, but not juvenile, display lack preference to a novel object. While working memory alteration observed only in adult male MIA-exposed offspring at late gestation day. In addition, we found that adult females MIA-exposed mice spent more time in the center of the open field than female-saline groups. On the other hand, juvenile male offspring exposed to MIA at early, but not late, gestation day displayed a significant alteration in social interaction. Our results suggest that MIA during late gestation immediately influences the expression levels of the NRG1 and ErbB4 genes, and affects long-term behavioral changes at adulthood. These behavioral changes are time related and sex-specific. Thus, immune activation at late stages of the embryonic brain development initiates the activation of the NRG1-ErbB4 pathway and this disturbance might result in cognitive dysfunction in adulthood.