An understanding of sleep requires the identification of distinct cellular circuits that mediate the action of specific sleep:wake-regulating molecules, but such analysis has been very limited. We identify here a circuit that underlies the wake-promoting effects of octopamine in Drosophila. Using MARCM, we identified the ASM cells in the medial protocerebrum as the wake-promoting octopaminergic cells. We then blocked octopamine signaling in random areas of the fly brain and mapped the postsynaptic effect to insulin-secreting neurons of the pars intercerebralis (PI). These PI neurons show altered potassium channel function as well as an increase in cAMP in response to octopamine, and genetic manipulation of their electrical excitability alters sleep:wake behavior. Effects of octopamine on sleep:wake are mediated by the cAMP-dependent isoform of the OAMB receptor. These studies define the cellular and molecular basis of octopamine action and suggest that the PI is a sleep:wake-regulating neuroendocrine structure like the mammalian hypothalamus.