Taking part in sport protects children who are abused or neglected from developing mental health problems in later life, according to a major public health study.

People who had adverse childhood experiences (ACEs) but regularly played sports as children were less likely to have a mental illness as an adult, the study found. People who had traumatic childhoods were also more likely to be mentally healthy if they took part in sport as adults.

The study confirmed a strong link between ACEs, which include sexual and physical abuse, parental separation and living with domestic violence, and mental illness as an adult.

It said people who had four or more ACEs were four times more likely to be receiving treatment for current mental illnesses and 10 times more likely to have self-harmed or felt suicidal than those who had experienced none.

The study from Public Health Wales (PHW) and Bangor University looked at what could help people with troubled upbringings. Published on Thursday, the report said: “Of childhood activities measured, only regular participation in sports showed a protective effect against mental illness.

“Among those with four or more ACEs, the adjusted proportion reporting current mental illness fell from 25% of those who did not regularly participate in childhood sports to 19% in those who did.”

The report urged caution: “It is not possible from this survey to explore whether participation in sports builds resilience in children or whether children with greater resilience are more attracted to sports.”

But it added: “The relationships found here suggest increased sports participation should be further explored as a means of developing resilience and protecting mental health.”

The report found that adults who were members of clubs and community groups were also more likely to be mentally well. It found that playing sport also helped adults, with the proportion of people being treated for a mental illness if they played sport almost half that of those who did not.

It said: “There are associations between regular adult participation in sports and current mental illness. While much attention has been paid to the cardiovascular and weight reduction potential of sports participation, its impact of friendship opportunities, benefits to mental health, access to role models and the other aspects of resilience that engagement in sports facilitates needs to be factored into its benefits.”

A previous report from PHW and Bangor University revealed that children who had ACEs were more likely to become physically ill as adults.

Children with four or more ACEs were more than twice as likely to be diagnosed with a chronic disease in later life than those who had experienced none, the report said.

They are four times more likely to develop type 2 diabetes, three times more likely to develop heart disease and three times more likely to develop respiratory disease.