Ultraviolet radiation (UV) induces an increase in multiple cutaneous inflammatory mediators. Ellagic acid (EA) and rosmarinic acid (RA) are natural anti-inflammatory and immunomodulatory compounds found in many plants, fruits, and nuts. We assessed the ability of EA and RA to modulate IL-1β, IL-6, IL-8, IL-10, MCP-1, and TNF-α gene expression in HaCaT cells after UVB irradiation. Cells were treated with UVB (100 mJ/cm(2)) and simultaneously with EA (5 μM in 0.1% DMSO) or RA (2.7 μM in 0.5% DMSO). Moreover, these substances were added to the UVB-irradiated cells 1 h or 6 h before harvesting, depending on the established UVB-induced cytokine expression peak. Cytokine gene expression was examined using quantitative real time polymerase chain reaction. RA produced a significant reduction in UVB-induced expression of IL-6, IL-8, MCP-1, and TNF-α when applied at the same time as irradiation. EA showed milder effects compared with RA, except for TNF-α. Both substances decreased IL-6 expression, also when applied 5 h after irradiation, and always produced a significant increase in UVB-induced IL-10 expression. Our findings suggest that EA and RA are able to prevent and/or limit the UVB-induced inflammatory cascade, through a reduction in proinflammatory mediators and the enhancement of IL-10, with its protective function.