The reversal of conventional sex roles was enigmatic to Darwin, who suggested that it may evolve when sex ratios are female biased . Here we present direct evidence confirming Darwin’s hypothesis. We investigated mating system evolution in a sex-role-reversed beetle (Megabruchidius dorsalis) using experimental evolution under manipulated sex ratios and food regimes. In female-biased populations, where reproductive competition among females was intensified, females evolved to be more attractive and the sex roles became more reversed. Interestingly, female-specific mating behavior evolved more rapidly than male-specific mating behavior. We show that sexual selection due to reproductive competition can be strong in females and can target much the same traits as in males of species with conventional mating systems. Our study highlights two central points: the role of ecology in directing sexual selection and the role that females play in mating system evolution.