We aimed to investigate the effect and mechanism of icariin on male sexual function. Forty-eight Crl:CD1(ICR) male mice were randomly divided into control, low-, medium- and high-dose icariin group (intragastric administration of 50, 100 and 200 mg/kg/d for 21 days). Mating experiment was then performed at a ratio of 1: 3 (male: female). The mating behaviours of male mice were recorded. The genital indexes and serum testosterone, nitric oxide (NO), hypothalamic dopamine (DA) and 5- hydroxy tryptophan (5-HT) concentrations were measured. The expression of endothelial nitric oxide (eNOS), phosphatidylinositol tallow alcohol 3-kinase (PI3K) and phosphorylated protein kinase (p-AKT) in penile tissue was detected by Western blot. All icariin groups exhibited shorter capture latency and ejaculation latency, increased number of capture and ejaculation, higher capture and ejaculation rate, and higher testicular and prostate indexes compared with controls (p < .001). These groups had higher serum testosterone and NO concentrations (p < .001), hypothalamic DA and 5-HT levels, and eNOS, PI3K and phosphorylated AKT expressions in penile tissue (p < .05). The effect of icariin was dose-dependently increased. Our study suggests that icariin improves the sexual function of male mice, which might be associated with the hypothalamic–pituitary–gonadal axis and the PI3K/AKT/eNOS/NO signalling pathway.