Evolutionary theory predicts that dioecious species should produce a balanced primary sex ratio maintained by frequency-dependent selection. Organisms with environmental sex determination, however, are vulnerable to maladaptive sex ratios, because environmental conditions vary spatio-temporally. For reptiles with temperature-dependent sex determination, nest-site choice is a behavioural maternal effect that could respond to sex-ratio selection, as mothers could adjust offspring sex ratios by choosing nest sites that will have particular thermal properties. This theoretical prediction has generated decades of empirical research, yet convincing evidence that sex-ratio selection is influencing nesting behaviours remains absent. Here, we provide the first experimental evidence from nature that sex-ratio selection, rather than only viability selection, is probably an important component of nest-site choice in a reptile with temperature-dependent sex determination. We compare painted turtle (Chrysemys picta) neonates from maternally selected nest sites with those from randomly selected nest sites, observing no substantive difference in hatching success or survival, but finding a profound difference in offspring sex ratio in the direction expected based on historical records. Additionally, we leverage long-term data to reconstruct our sex ratio results had the experiment been repeated in multiple years. As predicted by theory, our results suggest that sex-ratio selection has shaped nesting behaviour in ways likely to enhance maternal fitness.