Histamine neurons are active during waking and largely inactive during sleep, with minimal activity during rapid-eye movement (REM) sleep. Caffeine, the most widely used stimulant, causes a significant increase of sleep onset latency in rats and humans. We hypothesized that caffeine increases glutamate release in the posterior hypothalamus (PH) and produces increased activity of wake-active histamine neurons. Using in vivo microdialysis, we collected samples from the PH after caffeine administration in freely behaving rats. HPLC analysis and biosensor measurements showed a significant increase in glutamate levels beginning 30 min after caffeine administration. Glutamate levels remained elevated for at least 140 min. GABA levels did not significantly change over the same time period. Histamine level significantly increased beginning 30 min after caffeine administration and remained elevated for at least 140 min. Immunostaining showed a significantly elevated number of c-Fos-labeled histamine neurons in caffeine-treated rats compared with saline-treated animals. We conclude that increased glutamate levels in the PH activate histamine neurons and contribute to caffeine-induced waking and alertness.