Males of many animal species engage in courtship behaviours during and after copulation that appear to be solely aimed at stimulating the female. It has been suggested that these behaviours have evolved by cryptic female choice, whereby females are thought to impose biases on male postmating paternity success. Males of the red flour beetle Tribolium castaneum rub the lateral edges of the females' elytra with their tarsi during copulation. We manipulated female perception of this behaviour by tarsal ablation in males, thus preventing males from reaching the edge of the female elytra with their manipulated legs, and by subsequently performing a series of double–mating experiments where the copulatory behaviour was quantified. We found a positive relationship between the intensity of the copulatory courtship behaviour and relative fertilization success among unmanipulated males. This pattern, however, was absent in manipulated males, where female perception of male behaviour differed from that actually performed. Thus, female perception of male copulatory courtship behaviour, rather than male behaviour per se, apparently governs the fate of sperm competing over fertilizations within the female, showing that copulatory courtship is under selection by cryptic female choice.