Water deprivation produces a drive to seek and consume water. How neural activity creates this motivation remains poorly understood. We used activity-dependent genetic labeling to characterize neurons activated by water deprivation in the hypothalamic median preoptic nucleus (MnPO). Single-cell transcriptional profiling revealed that dehydration-activated MnPO neurons consist of a single excitatory cell type. After optogenetic activation of these neurons, mice drank water and performed an operant lever-pressing task for water reward with rates that scaled with stimulation frequency. This stimulation was aversive, and instrumentally pausing stimulation could reinforce lever-pressing. Activity of these neurons gradually decreased over the course of an operant session. Thus, the activity of dehydration-activated MnPO neurons establishes a scalable, persistent, and aversive internal state that dynamically controls thirst-motivated behavior.