In complex and ever-changing environments, resources such as food are often scarce and unevenly distributed in space and time. Therefore, utilizing external cues to locate and remember high-quality sources allows more efficient foraging, thus increasing chances for survival. Associations between environmental cues and food are readily formed because of the tangible benefits they confer. While examples of the key role they play in shaping foraging behaviours are widespread in the animal world, the possibility that plants are also able to acquire learned associations to guide their foraging behaviour has never been demonstrated. Here we show that this type of learning occurs in the garden pea, Pisum sativum. By using a Y-maze task, we show that the position of a neutral cue, predicting the location of a light source, affected the direction of plant growth. This learned behaviour prevailed over innate phototropism. Notably, learning was successful only when it occurred during the subjective day, suggesting that behavioural performance is regulated by metabolic demands. Our results show that associative learning is an essential component of plant behaviour. We conclude that associative learning represents a universal adaptive mechanism shared by both animals and plants.