The widespread presence of same-sex sexual behavior (SSB) has long been thought to pose an evolutionary conundrum 1-3 , as participants in SSB suffer the cost of failing to reproduce after expending the time and energy to find a mate. The potential for SSB to occur as part of an optimal strategy has received almost no attention, although indiscriminate sexual behavior may be the ancestral mode of sexual reproduction 4 . Here, we build a simple model of sexual reproduction and create a theoretical framework for the evolution of indiscriminate sexual behavior. We provide strong support for the hypothesis that SSB is likely maintained by selection for indiscriminate sexual behavior, by showing that indiscriminate mating is the optimal strategy under a wide range of conditions. Further, our model suggests that the conditions that most strongly favor indiscriminate mating were likely present at the origin of sexual behavior. These findings have implications not only for the evolutionary origins of SSB, but also for the evolution of discriminate sexual behavior across the animal kingdom.Empirical observations of same-sex sexual behavior (SSB; i.e., any attempted sexual activity between two or more members of the same sex) in animals are widespread, with evidence of SSB in mammals 5-9 , birds 10-14 , arthropods [15][16][17][18][19] , mollusks [20][21][22] , echinoderms [23][24][25] , and other animals [26][27][28][29][30] . Since SSB is traditionally thought to be deleterious, as same-sex matings require energy expenditure but cannot produce offspring, there has been much interest in understanding its origin and maintenance [1][2][3][4][5] . Despite this, there exists no strong theoretical foundation for understanding SSB (but see 31,32 ), resulting in a wide range of untested verbal arguments in the literature [1][2][3][4][5] .Recently, Monk et al. 4 challenged the longstanding perspective of SSB as a derived trait, arguing that rather than trying to understand its presence, a more salient question would be to .