Much of the research on learning in fruit flies has focused on the genetic and cellular basis of learning. The evolutionary relevance of learning in these tiny, short-lived insects is not well understood. Relying on the knowledge that male fruit flies learn in the context of courtship, I tested whether such learning improves male courtship. I found, first, that compared with inexperienced males, males with experience courting recently mated, unreceptive females were slower to begin courtship of novel recently mated females and spent less time courting such females. The experienced males, however, began courting virgin females sooner than did inexperienced males and courted such females as long as did inexperienced males. Second, compared with males experienced with recently mated females, males experienced with immature, unreceptive females were faster to approach either virgin or recently mated females and courted virgin females longer. These results indicate that courting experience permits male fruit flies to refine their courtship behaviour in a way that could increase their mating success.