A fundamental property of visual cortex is to enhance the representation of those stimuli that are relevant for behavior, but it remains poorly understood how such enhanced representations arise during learning. Using classical conditioning in mice, we show that orientation discrimination is learned in a sequence of distinct behavioral stages, in which animals first rely on stimulus appearance before exploiting its orientation to guide behavior. After confirming that orientation discrimination under classical conditioning requires primary visual cortex (V1), we measured, during learning, response properties of V1 neurons. Learning improved neural discriminability, sharpened orientation tuning and led to higher contrast sensitivity. Remarkably, these learning-related improvements in the V1 representation were fully expressed before successful orientation discrimination was evident in the animals' behavior. We propose that V1 plays a key role early in discrimination learning to enhance behaviorally relevant sensory information.