During learning, multi-dimensional inputs are integrated within the sensory cortices. However, the strategies by which the sensory cortex employs to achieve learning remains poorly understood. We studied the sensory cortical neuronal coding of trace eyeblink conditioning (TEC) in head-fixed, freely running mice, where whisker deflection was used as a conditioned stimulus (CS) and an air puff to the cornea delivered after an interval was used as unconditioned stimulus (US). After training, mice learned the task with a set of stereotypical behavioral changes, most prominent ones include prolonged closure of eyelids, and increased reverse running between CS and US onset. The local blockade of the primary somatosensory cortex (S1) activities with muscimol abolished the behavior learning suggesting that S1 is required for the TEC. In naive animals, based on the response properties to the CS and US, identities of the small proportion (~20%) of responsive primary neurons (PNs) were divided into two subtypes: CR (i.e. CS-responsive) and UR neurons (i.e. US-responsive). After animals learned the task, identity of CR and UR neurons changed: while the CR neurons are less responsive to CS, UR neurons gain responsiveness to CS, a new phenomenon we defined as 'learning induced neuronal identity switch (LINIS)'. To explore the potential mechanisms underlying LINIS, we found that systemic and local (i.e. in S1) administration of the nicotinic receptor antagonist during TEC training blocked the LINIS, and concomitantly disrupted the behavior learning. Additionally, we monitored responses of two types of cortical interneurons (INs) and observed that the responses of the somatostatin-expressing (SST), but not parvalbumin-expressing (PV) INs are negatively correlated with the learning performance, suggesting that SST-INs contribute to the LINIS. Thus, we conclude that L2/3 PNs in S1 encode perceptual learning by LINIS like mechanisms, and cholinergic pathways and cortical SST interneurons are involved in the formation of LINIS.