Sunbathing can slow the ageing process by up to five years, according to new research.

Scientists have found that people who avoid the sun, or have inadequate vitamin D in their diet, are subject to genetic damage associated with ageing and age-related illnesses.

The effect of the damage is so great that those who lack vitamin D - often called the "sunshine vitamin" because 90 per cent of the body's intake is created by exposure to the sun - were biologically five years older than those with the highest levels.

Lead researcher Dr Brent Richards, from King's College, London said: "These results are exciting because they demonstrate for the first time that people with high levels of vitamin D may age more slowly than people with lower levels.

"This helps to explain how vitamin D has a protective effect on age-related illnesses such as heart disease."

Co-author Prof Tim Spector, also of King's College, said the study showed people should spend more time in the sun and eat more foods rich in vitamin D such as fish, eggs, fortified milk and breakfast cereals, or take supplements.

About one-third of the population is thought to be vitamin D deficient. Prof Spector said: "There are scares about melanomas, which do affect several thousand people per year.

"But vitamin D deficiency is making hundreds of thousands of people ill with potentially fatal diseases."

Cancer campaigners pointed out that too much exposure to the sun can cause skin cancer, which kills about 1,800 people in the UK each year.

Henry Scowcroft, of Cancer Research UK, said: "It doesn't take much time in the sun to make vitamin D, and always less time than it takes to redden or burn."