Beetles are the most diverse animal group on the planet. Their evolutionary success suggests unique physiological adaptations in overcoming water stress, yet the mechanisms underlying this ability are unknown. Here we use molecular genetic, electrophysiology, and behavioral studies to show that a group of brain neurons responds to osmotic disturbances by releasing diuretic hormones that regulate salt and water balance. These hormones bind to their receptor exclusively localized to a unique secondary cell in the Malpighian tubules to modulate fluid secretion and organismal water loss. This tubule architecture, common to all higher beetle families, is novel within the insects, and provides an important clue to the evolutionary success of the beetles in colonizing an astounding range of habitats on Earth.