People who walk or cycle to work have better mental health than those who drive cars, a new study has found.

The study, conducted by researchers at the University of East Anglia and the Centre for Diet and Activity Research (CEDAR), has discovered that wellbeing is tied with regular physical activity - even if it is just walking or cycling to office. Even public transport, researchers say, was better than driving for workers.

"One surprising finding was that commuters reported feeling better when travelling by public transport, compared to driving. You might think that things like disruption to services or crowds of commuters might have been a cause of considerable stress. But as buses or trains also give people time to relax, read, socialise, and there is usually an associated walk to the bus stop or railway station, it appears to cheer people up," said Adam Martin, from UEA's Norwich Medical School, lead author of the study, according to a news release.

Data for the research came from 18,000 people from Britain. The participants were about 18 to 65 years old. The researchers looked at various aspects of psychological health including sleepless nights, unhappiness and being unable to face problems.

The team found that the longer people sat in a car while travelling to work, the lower their psychological wellbeing was. On the contrary, people who walked to work had greater mental health.

The latest research challenges an earlier report that tied walking and cycling to mental stress. UK Office of National Statistics had published a study, 'Commuting and Personal Wellbeing, 2014', that stated that cyclists were less happy than people who used cars to reach their workplace.

The study is published in the journal Preventive Medicine.

Related research has shown that driving for just two hours a day can result in several health problems.