Parents who possess the courage to separate their children from their smartphones may be helping their kids’ brainpower, a new study suggests.

Children who use smartphones and other devices in their free time for fewer than two hours a day performed better on cognitive tests assessing their thinking, language and memory, according to a study published Wednesday in the Lancet Child & Adolescent Health.

The study assessed the behavior of 4,500 children, ages 8 to 11, by looking at their sleep schedules, how much time they spent on screens and their amount of exercise, and analyzed how those factors affected the children’s mental abilities.

The researchers compared the results with national guidelines for children’s health. The guidelines recommend that children in that age group get at least an hour of physical activity, no more than two hours of recreational screen time and nine to 11 hours of sleep per night.

The researchers found that only 5 percent of children met all three recommendations. Sixty-three percent of children spent more than two hours a day staring at screens, failing to meet the screen-time limit.

Children who failed to meet all three criteria performed worse on thinking, language and memory tests than kids who met the recommendations, according to the study. But reduced screen time was positively linked to superior mental performance, the study found.

“We need to pay attention to how long we are on the screens for,” said Jeremy Walsh, a post doctoral fellow at the University of British Columbia and the lead author of the study. “This study is showing that less than two hours of recreational screen time is beneficial for children.”

“These findings highlight the importance of limiting recreational screen time and encouraging healthy sleep to improve cognition in children,” the study’s authors wrote.

The findings arrive as technology companies take steps to address worries over increased device use.

In recent months calls from parents, consumers and technologists have elevated a conversation about young people and concerns about tech addiction and whether device use could harm childhood development.

While the observational study captured a snapshot of a child’s cognitive abilities, and only showed an association between reduced screen time and higher mental performance, it did not establish a causal link, according to the BBC.

The study’s authors said that more research is needed to probe the links between screen time and cognition, including research that differentiates between different types of screen time activities and what effects they have.