Carbon dioxide (CO 2 ) elicits an attractive host-seeking response from mosquitos [1–3] yet is innately aversive to Drosophila melanogaster [4, 5] despite being a plentiful byproduct of attractive fermenting food sources. Prior studies used walking flies exclusively, yet adults track distant food sources on the wing [6]. Here we show that a fly tethered within a magnetic field allowing free rotation about the yaw axis [7] actively seeks a narrow CO 2 plume during flight. Genetic disruption of the canonical CO 2 -sensing olfactory neurons does not alter in-flight attraction to CO 2 ; however, antennal ablation and genetic disruption of the Ir64a acid sensor do. Surprisingly, mutation of the obligate olfactory coreceptor (Orco [8]) does not abolish CO 2 aversion during walking [4] yet eliminates CO 2 tracking in flight. The biogenic amine octopamine regulates critical physiological processes during flight [9–11], and blocking synaptic output from octopamine neurons inverts the valence assigned to CO 2 and elicits an aversive response in flight. Combined, our results suggest that a novel Orco-mediated olfactory pathway that gains sensitivity to CO 2 in flight via changes in octopamine levels, along with Ir64a, quickly switches the valence of a key environmental stimulus in a behavioral-state-dependent manner.