Testes were associated with maleness from antiquity, and ancient societies had fanciful myths about the origins of the sexes and about fetal sexual development. 17th century anatomists developed the concept that mammals developed from eggs and discovered sperm in semen; in 1878, Hertwig observed sperm entering eggs (of sea urchins), establishing the cellular basis of sex development. Individuals with atypical genitalia were known clinically in the 17th century, with much debate about their origins, but by the late 19th century it was generally accepted that gonads determined sex, and that sex determined gender role. Testosterone was isolated in 1935, and Alfred Jost showed that both circulating testosterone and diffusible anti-Mullerian hormone were needed for male development. Patients with apparent androgen insensitivity were reported in 1937 and shown to be unresponsive to exogenous androgen by Lawson Wilkins in 1957; androgen receptor mutations were reported in 1989. Steroidogenic errors were associated with differences in sex development (DSDs) starting in the 1940s, and finding mutations in the responsible enzymes explained many forms of hyper- and hypo-androgenism in both sexes. Sex chromosomes were identified in the early 20th century; Y was associated with maleness, and the responsible <i>SRY</i> gene was identified in 1991. Early efforts to manage patients with DSDs were confounded by philosophical perspectives on the relative roles of prenatal biology versus postnatal environment. Approaches to natal sex assignment evolved in the later 20th century and now emphasize a team approach based on data, not guessing, parental involvement, cultural considerations, and the acknowledgement of uncertainty.