Neuronal firing patterns, neuromodulators, and cerebral metabolism change across sleep-waking states, and the synaptic release of glutamate is critically involved in these processes. Extrasynaptic glutamate can also affect neural function and may be neurotoxic, but whether and how extracellular glutamate is regulated across sleep-waking states is unclear. To assess the effect of behavioral state on extracellular glutamate at high temporal resolution, we recorded glutamate concentration in prefrontal and motor cortex using fixed-potential amperometry in freely behaving rats. Simultaneously, we recorded local field potentials (LFPs) and electroencephalograms (EEGs) from contralateral cortex. We observed dynamic, progressive changes in the concentration of glutamate that switched direction as a function of behavioral state. Specifically, the concentration of glutamate increased progressively during waking (0.329 +/- 0.06%/min) and rapid eye movement (REM) sleep (0.349 +/- 0.13%/min). This increase was opposed by a progressive decrease during non-REM (NREM) sleep (0.338 +/- 0.06%/min). During a 3 h sleep deprivation period, glutamate concentrations initially exhibited the progressive rise observed during spontaneous waking. As sleep pressure increased, glutamate concentrations ceased to increase and began decreasing despite continuous waking. During NREM sleep, the rate of decrease in glutamate was positively correlated with sleep intensity, as indexed by LFP slow-wave activity. The rate of decrease doubled during recovery sleep after sleep deprivation. Thus, the progressive increase in cortical extrasynaptic glutamate during EEG-activated states is counteracted by a decrease during NREM sleep that is modulated by sleep pressure. These results provide evidence for a long-term homeostasis of extracellular glutamate across sleep-waking states.