Plant defense compounds occur in floral nectar, but their ecological role is not well understood. We provide evidence that plant compounds pharmacologically alter pollinator behavior by enhancing their memory of reward. Honeybees rewarded with caffeine, which occurs naturally in nectar of Coffea and Citrus species, were three times as likely to remember a learned floral scent as were honeybees rewarded with sucrose alone. Caffeine potentiated responses of mushroom body neurons involved in olfactory learning and memory by acting as an adenosine receptor antagonist. Caffeine concentrations in nectar did not exceed the bees' bitter taste threshold, implying that pollinators impose selection for nectar that is pharmacologically active but not repellent. By using a drug to enhance memories of reward, plants secure pollinator fidelity and improve reproductive success.