Rapid sensory adaptation is observed across all sensory systems, and strongly shapes sensory percepts in complex sensory environments. Yet despite its ubiquity and likely necessity for survival, the mechanistic basis is poorly understood. A wide range of studies primarily in in-vitro and anesthetized preparations have pointed to the emergence of adaptation effects at the level of primary sensory cortex, with only modest signatures in earlier stages of processing. The nature of rapid adaptation and how it shapes sensory representations during wakefulness, and thus the potential role in adaptive changes in perception, is unknown, as are the mechanisms that underlie this phenomenon. To address these unknowns, we recorded spiking activity in primary somatosensory cortex (S1) and the upstream ventral posteromedial (VPm) thalamic nucleus in the vibrissa pathway of the awake mouse, and quantified responses to whisker stimuli delivered in isolation and embedded in an adapting sensory background. We found that during wakefulness, cortical sensory responses were indeed adapted by persistent sensory stimulation; putative excitatory neurons were profoundly adapted, and inhibitory neurons only modestly so. Further optogenetic manipulation experiments and network modeling suggest this largely reflects adaptive changes in synchronous thalamic firing combined with robust engagement of feedforward inhibition, with little contribution from synaptic depression. Taken together, these results suggest that cortical adaptation largely reflects changes in timing of thalamic input, and the way in which this differentially impacts cortical excitation and feedforward inhibition, pointing to a prominent role of thalamic gating in rapid adaptation of primary sensory cortex.Significance StatementRapid adaptation of sensory activity strongly shapes representations of sensory inputs across all sensory pathways over the timescale of seconds, and has profound effects on sensory perception. Despite its ubiquity and theoretical role in the efficient encoding of complex sensory environments, the mechanistic basis is poorly understood, particularly during wakefulness. In this study in the vibrissa pathway of awake mice, we show that cortical representations of sensory inputs are strongly shaped by rapid adaptation, and that this is mediated primarily by adaptive gating of the thalamic inputs to primary sensory cortex and the differential way in which these inputs engage cortical sub-populations of neurons.