The prefrontal cortex (PFC) plays an important role in regulating social functions in mammals, and its dysfunction has been linked to social deficits in neurodevelopmental disorders. Yet little is known of how the PFC encodes social information and how social representations may be altered in such disorders. Here, we show that neurons in the medial PFC of freely behaving male mice preferentially respond to socially relevant olfactory cues. Population activity patterns in this region differed between social and nonsocial stimuli and underwent experience-dependent refinement. In mice lacking the autism-associated gene Cntnap2, both the categorization of sensory stimuli and the refinement of social representations were impaired. Noise levels in spontaneous population activity were higher in Cntnap2 knockouts and correlated with the degree to which social representations were disrupted. Our findings elucidate the encoding of social sensory cues in the medial PFC and provide a link between altered prefrontal dynamics and autism-associated social dysfunction.