Prenatal and early postnatal infection have been associated with changes in microglial activity and the development of psychiatric disorders. Here, we investigated the effect of prenatal immune activation and postnatal immune challenge, alone and combined, on behavior and microglial cell density in female Wistar rats. Pregnant rats were injected with poly I:C to induce a maternal immune activation (MIA). Their female offspring were subsequently exposed to a lipopolysaccharide (LPS) immune challenge during adolescence. Anhedonia, social behavior, anxiety, locomotion, and working memory were measured with the sucrose preference, social interaction, open field, elevated-plus maze, and Y-maze test, respectively. Microglia cell density was quantified by counting the number of Iba-1 positive cells in the brain cortex. Female MIA offspring were more susceptible to the LPS immune challenge during adolescence than control offspring as demonstrated by a more pronounced reduction in sucrose preference and body weight on the days following the LPS immune challenge. Furthermore, only the rats exposed to both MIA and LPS showed long-lasting changes in social behavior and locomotion. Conversely, the combination MIA and LPS prevented the anxiety induced by MIA alone during adulthood. MIA, LPS, or their combination did not change microglial cell density in the parietal and frontal cortex of adult rats. The results of our study suggest that the maternal immune activation during pregnancy aggravates the response to an immune challenge during adolescence in female rats.