The brain's response to sensory input is strikingly modulated by behavioral state. Notably, the visual response of mouse primary visual cortex (V1) is enhanced by locomotion, a tractable and accessible example of a time-locked change in cortical state. The neural circuits that transmit behavioral state to sensory cortex to produce this modulation are unknown. In vivo calcium imaging of behaving animals revealed that locomotion activates vasoactive intestinal peptide (VIP)-positive neurons in mouse V1 independent of visual stimulation and largely through nicotinic inputs from basal forebrain. Optogenetic activation of VIP neurons increased V1 visual responses in stationary awake mice, artificially mimicking the effect of locomotion, and photolytic damage of VIP neurons abolished the enhancement of V1 responses by locomotion. These findings establish a cortical circuit for the enhancement of visual response by locomotion and provide a potential common circuit for the modulation of sensory processing by behavioral state.