How intracortical recurrent circuits in mammalian sensory cortex influence dynamics of sensory representation is not understood. Previous methods could not distinguish the relative contributions of recurrent circuits and thalamic afferents to cortical dynamics. We accomplish this by optogenetically manipulating thalamus and cortex. Over the initial 40 ms of visual stimulation, excitation from recurrent circuits in visual cortex progressively increased to exceed direct thalamocortical excitation. Even when recurrent excitation exceeded thalamic excitation, upon silencing thalamus, sensory-evoked activity in cortex decayed rapidly, with a time constant of 10 ms, which is similar to a neuron's integration time window. In awake mice, this cortical decay function predicted the time-locking of cortical activity to thalamic input at frequencies <15 Hz and attenuation of the cortical response to higher frequencies. Under anesthesia, depression at thalamocortical synapses disrupted the fidelity of sensory transmission. Thus, we determine dynamics intrinsic to cortical recurrent circuits that transform afferent input in time.