Adding more walks to your weekly routine may actually protect you from getting sick as often, suggests a recent study published in Medicine & Science in Sports & Exercise.

Danish researchers studied data culled from two health surveys of Danes taken in 2007 and 2010. Out of the 18,874 participants who answered questions about their physical activity, more than 5,000 obtained a prescription for antibiotics within a year’s time. The researchers found that people who reported a low or moderate level of physical activity were less likely to receive antibiotics for a suspected bacterial infection than people who were entirely sedentary. After accounting for other variables, such as smoking history or weight, a low level of physical activity was still associated with a 10 percent lower risk of bacterial infection during the study period, with women benefiting more than men.

“These results indicate that practitioners should be aware of physical activity as a potential preventive factor for bacterial infections in the work of disease prevention and health promotion.” concluded the authors.

The study’s findings come on the heels of research showing a similar connection between physical activity and common viral infections. Unlike these earlier efforts, however, there wasn’t a significant association seen with respiratory infections caused by bacteria. Conversely, the protective effect was largest in women and men suffering from suspected cystitis, or urinary tract infections caused by bacteria, though women were by far its most frequent sufferers.

When the researchers looked exclusively at men and accounted for other factors, the link wasn’t strong enough to conclude it existed. Overall, though, the relationship between exercise and infections appeared to follow a J-shaped curve in men, meaning that light or moderate exercise reduced the risk of infection compared to sedentary behavior while vigorous exercise slightly raised it. In women, vigorous exercise wasn’t conclusively linked to reduced infection risk, but it wasn’t associated with a higher risk either.

Given that sedentary behavior leads to plenty of other health problems, though, it’s safe to say exercising too much is a lot healthier for you than not bothering at all. But the study does suggest that there’s no need to start training for your closest marathon in order to reap the most powerful benefits from exercise. Elsewhere, recent research has shown that even moderate exercise can save people hundreds or more in medical bills annually.

The researchers defined low physical activity as at least four hours weekly of “strolling, riding a bicycle, or other light physical activity,” and moderate physical activity as at least four hours weekly of “exercise through sports or heavy gardening or similar activities.”

Source: Pape K, Ryttergaard L, Rotevatn T, et al. Leisure-Time Physical Activity and the Risk of Suspected Bacterial Infections. Medicine & Science in Sports & Exercise. 2016.