Spermatozoa exhibit taxonomically widespread patterns of divergent morphological evolution. However, the adaptive significance of variation in sperm morphology remains unclear. In this study we examine the role of natural variation in sperm length on fertilization success in the dung beetle Onthophagus taurus. We conducted sperm competition trials between males that differed in the length of their sperm and determined the paternity of resulting offspring using amplified fragment length polymorphism (AFLP) markers. We also quantified variation in the size and shape of the female's sperm storage organ to determine whether female morphology influenced the competitiveness of different sperm morphologies. We found that fertilization success was biased toward males with relatively shorter sperm, but that selection on sperm length was dependent on female tract morphology; selection was directional for reduced sperm length across most of the spermathecal size range, but stabilizing in females with the smallest spermathecae. Our data provide empirical support for the theory that sperm competition should favor the evolution of numerous tiny sperm. Moreover, because sperm length is both heritable and genetically correlated with condition, our results are consistent with a process by which females can accrue genetic benefits for their offspring from the incitement of sperm competition and/or cryptic female choice, as proposed by the "sexy sperm" and "good sperm" models for the evolution of polyandry.