Ultraviolet (UV) light affects endocrinological and behavioral aspects of sexuality via an unknown mechanism. Here we discover that ultraviolet B (UVB) exposure enhances the levels of sex-steroid hormones and sexual behavior, which are mediated by the skin. In female mice, UVB exposure increases hypothalamus-pituitary-gonadal axis hormone levels, resulting in larger ovaries; extends estrus days; and increases anti-Mullerian hormone (AMH) expression. UVB exposure also enhances the sexual responsiveness and attractiveness of females and male-female interactions. Conditional knockout of p53 specifically in skin keratinocytes abolishes the effects of UVB. Thus, UVB triggers a skin-brain-gonadal axis through skin p53 activation. In humans, solar exposure enhances romantic passion in both genders and aggressiveness in men, as seen in analysis of individual questionaries, and positively correlates with testosterone level. Our findings suggest opportunities for treatment of sex-steroid-related dysfunctions.