The present invention provides a composition containing a) clay material with a negative surface charge; b) magnesium ions and calcium ions both either incorporated within the clay material and/or added separately; c) water and/or non-aqueous solvent; d) substantially non-cationic carrier; where i) the mean particle size of the clay material is at least 5 nm; and ii) the total molar amount of magnesium ions is higher than the total molar amount of calcium ions. The present invention further relates to the use of said composition in the manufacture of a medicament for the prophylaxis and treatment of skin diseases, skin conditions, or mucosal diseases where the formation and/or recovery of epidermal/mucosal barrier function has beneficial effects.