Insects, unlike vertebrates, are generally believed to lack steroid hormones with functions predominantly associated with adult male biology. In the malaria mosquito Anopheles gambiae, the ecdysteroid 20-hydroxyecdysone (20E) appears to both control egg development in females and induce mating refractoriness and oviposition when sexually transferred by males. Here we show that these sex-specific functions are instead carried out by distinct steroids. We identify a male-specific oxidized form of 20E (3D20E) that upon sexual transfer switches off female mating receptivity, ensuring male paternity. Endogenous female 20E does not induce mating refractoriness, while it triggers oviposition in mated females when expression of a 20E-inhibiting kinase is repressed. 3D20E and 20E have different downstream targets, with 3D20E inducing expression of a tolerance factor that preserves female fitness during Plasmodium infection. The evolution of this male steroid has therefore not only shaped the mating biology of An. gambiae, but also impacted malaria transmission.