Sleep improves cognitive performance, yet little is known about the neural mechanisms of this improvement. We performed multielectrode recording in macaque visual and dorsolateral prefrontal cortex while animals performed a visual discrimination task before and after non-rapid eye movement (NREM) sleep. Although sleep induces synchronized fluctuations in population activity across cortical areas, the post-sleep population activity became more desynchronized relative to the pre-sleep state. The changes after sleep were correlated with an increase in information encoded in population activity in each area and improved behavioral performance. Electrically stimulating visual cortex at 4 hertz emulated the beneficial effects of sleep on network and perceptual performance. A large-scale neural network model indicated that asymmetric depression of local intracortical synapses is consistent with the observed changes in neural activity after sleep.