The hours you log surfing the web and zoning out in front of the TV are a recipe for heart disease and other conditions and early death, right? After all, screen time, by definition, is sedentary behavior, a major health risk factor.

Maybe not.

A new study reveals that what you do in the hours that you’re not watching a screen makes a big difference in whether those screen hours really are harming your health. The results might be enough to get you up off that couch or out of your chair—or at worst, make you feel less guilty about binge-watching Game of Thrones. But it’s not quite a free pass for TV addicts.

Hazards of Screen Time

Over the past several years, the very act of doing a lot of sitting has come to be regarded as a harmful activity that degrades our health, and that was thought to be true even if we were active when we weren’t sitting. But is it really true? Researchers at Glasgow University wondered, so they analyzed data compiled on 390,089 men and women, ages 40 to 69, who participated in the UK Biobank, an ongoing, population-based study in England, Scotland and Wales that tracks many health factors, including diet and fitness. Participants were followed for a median of five years. Their screen time ranged from an average of less than two hours per day to more than five hours per  day and included any TV viewing plus computer use that wasn’t related to work. Screen time with phones and tablets wasn’t tracked.

The researchers’ most significant finding wasn’t surprising at all. As the amount of time devoted to channel- and web-surfing increased, so too did the risk for cardiovascular disease, cancer and cancer deaths, as well as death from all causes. But when the researchers filtered the data for fitness levels, everything changed.

The striking finding: Screen-time-related health risk applied only to the men and women who were inactive when not watching TV or web surfing, out of shape and not so strong. Their risk was almost double that of the participants who were fit, active and strong—for whom there was little or no hazard from increasing screen time. (There was a slight trend toward a very small increased risk in the fit, but it wasn’t statistically significant.)

The Three Fitness Measures That Mattered

The researchers looked at three separate measures of fitness. Two are well-known— physical activity level and cardiovascular fitness. The third is less common—grip strength.

To measure physical activity, researchers totaled the time participants spent walking every week, along with any moderate or vigorous activity they engaged in such as sports or gym time. Cardiovascular fitness was calculated by measuring how intensely individuals could exercise and how much oxygen they metabolized while pedaling on a stationary bike.

To measure grip strength, the researchers used a device called a hand dynamometer, which, when squeezed, records the strength of a person’s hand and forearm. It tends to also be a good indicator of the overall muscle strength in a person’s arms and legs and is fast and simple.

After adjusting for lifestyle factors including smoking, diet, blood pressure and BMI (body-mass index), the results were dramatic. Those in the lowest third of grip strength were at high health risk for extra screen time—health outcomes got worse as their average screen hours rose. But those in the top third of grip strength had no increased risk from extra screen time.

In fact, it didn’t matter which of the three measures were analyzed—scoring in the top third of any of them was protective. The researchers acknowledge that genes connected with fitness and strength could play a part in explaining their results, as could physical activity earlier in life.

Every study has limitations, of course—this one is observational, so it can’t establish cause and effect. But if future research does show causation, the authors conclude, it would mean that people with low fitness would reap the biggest benefits from spending less time in front of screens—while people who are fit have a lot less to worry about.

To be sure, this study doesn’t give you carte blanche to binge-watch hours of TV every night—even if you are fit. Nonetheless, if you regularly engage in walking, biking, jogging, swimming, dancing or another form of aerobic exercise—as well as an activity that increases your strength—spending a few hours each day devoted to TV or computer use may not be harmful after all.

Relax, enjoy—you’ve earned it.