Lack of a natural acid that keeps skin healthy could explain why some people are more likely to have eczema, a study suggests.

Edinburgh University researchers made the discovery using blood and skin donated by students and staff, as well as samples from hospital patients.

They found a shortage of cis-urocanic acid cells could affect how well the skin's immune system works. The acid appears to regulate immune cells and in its absence the skin can become inflamed.

Cis-urocanic acid is made from a protein called filaggrin, which helps to build a protective barrier in the outer layers of skin. Up to half of people of European descent who have eczema have an altered version of the gene.

The acid is made by the skin in response to sunlight and it is thought this could explain why some people find their eczema gets better in sunshine.

Skin specialist Dr Claire Leitch, who took part in the research, said: "Our study suggests the filaggrin protein, and the cis-urocanic acid it forms, are important for building protective barriers in the skin.

"This helps to stop the skin over-reacting to dust, detergents and other irritants."

The study is published in the Journal of Allergy and Clinical Immunology and was funded by groups including the Foundation for Skin Research and the British Skin Foundation.