Eating fast food is like giving your body a bacterial infection, according to new research into how the high-fat diet affects the immune system.

Scientists described high-fat and high-calorie foods as the “Western diet” and said that when they put mice on the regimen, it “induced systemic inflammation” that persisted even after the mice were back on their normal diets, a study in the journal Cell explained.

The foods contained a lot of fat and sugar and not much fiber. When a mouse was eating them, its immune system’s inflammatory response was akin to what it would do in the presence of a bacterial infection.

“The unhealthy diet led to an unexpected increase in the number of certain immune cells in the blood of the mice,” researcher Anette Christ said in a statement from the University of Bonn in Germany.

Although the inflammation dissipated once the unhealthy diet was replaced with a better one, the genetic changes linked to an aggressive immune response that the Western diet brought on remained. This kind of lingering effect is not unheard of — the body uses a sort of “memory” of its past experiences to better protect itself in the future, although those past experiences are often things like infections. When a dangerous pathogen comes along, it unlocks the immune system’s memories so the body’s defenses can mount a faster and more effective response.

The new research extends this concept to foods with poor nutritional value.

“Fast food thus causes the body to quickly recruit a huge and powerful army,” the university explained.

According to the scientists, having a more stimulated immune system could have health consequences down the road, like diabetes and heart problems.

“The foundations of a healthy diet need to become a much more prominent part of education than they are at present,” researcher Eicke Latz said in the statement. “Only in this way can we immunize children at an early stage against the temptations of the food industry. Children have a choice of what they eat every day. We should enable them to make conscious decisions regarding their dietary habits.”