The molecular mechanisms underlying the stability of mature neurons and neural circuits are poorly understood. Here we explore this problem and discover that the Hox genes are a component of the genetic program that maintains normal neural function in adult Drosophila. We show that post-developmental downregulation of the Hox gene Ultrabithorax (Ubx) in adult neurons leads to substantial anomalies in flight. Mapping the cellular basis of these effects reveals that Ubx is required within a subset of dopaminergic neurons, and cell circuitry analyses in combination with optogenetics allow us to link these dopaminergic neurons to flight control. Functional imaging experiments show that Ubx is necessary for normal dopaminergic activity, and neuron-specific RNA-sequencing defines two previously uncharacterized ion channel-encoding genes as potential mediators of Ubx behavioral roles. Our study thus reveals a novel role of the Hox system in controlling adult behavior and neural function.Based on the broad evolutionary conservation of the Hox system across distantly related animal phyla, we predict that the Hox genes might play neurophysiological roles in adult forms of other species, including humans.