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

The study suggests that a shortage of the acid could affect how well immune system cells in the skin work. The acid appears to regulate immune cells and in its absence the skin could become inflamed, researchers say.

Scientists studied the acid - known as cis-urocanic acid - which is made from a protein that helps to build a protective barrier in the outer layers of skin.

An altered version of the gene that produces the protein - called filaggrin - is known to be found in up to half of people of European descent who have eczema. The altered gene could affect their ability to make cis-urocanic acid, the team says.

Researchers at the University of Edinburgh made the discovery using blood and skin donated by patients, students and staff volunteers in hospitals in Edinburgh and Glasgow and the University of Edinburgh.

Cis-urocanic acid is made by the skin in response to sunlight. Researchers believe this could explain why some people find their eczema gets better in sunshine.

The study is published in the Journal of Allergy and Clinical Immunology.

Skin specialist Dr Claire Leitch, who took part in the research by the University's Medical Research Council Centre for Inflammation 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 research has been funded by the Foundation for Skin Research, the British Skin Foundation, the Edinburgh Dermatology Research Fund, the Medical Research Council, the Commonwealth Scholarship Commission and the Wellcome Trust.