The need to sleep grows with the duration of wakefulness and dissipates with time spent asleep, a process called sleep homeostasis. What are the consequences of staying awake on brain cells, and why is sleep needed? Surprisingly, we do not know whether the firing of cortical neurons is affected by how long an animal has been awake or asleep. Here, we found that after sustained wakefulness cortical neurons fire at higher frequencies in all behavioral states. During early NREM sleep after sustained wakefulness, periods of population activity (ON) are short, frequent, and associated with synchronous firing, while periods of neuronal silence are long and frequent. After sustained sleep, firing rates and synchrony decrease, while the duration of ON periods increases. Changes in firing patterns in NREM sleep correlate with changes in slow-wave activity, a marker of sleep homeostasis. Thus, the systematic increase of firing during wakefulness is counterbalanced by staying asleep.