Olfactory perception relies on an active sampling process, sniffing, to rapidly deliver odorants from the environment to the olfactory receptors. The respiration cycle strongly patterns the flow of information into the olfactory systems, but the behavioral significance of particular sniffing patterns is not well understood. Here, we monitored the frequency and timing of nasal respiration in rats performing an odor-mixture-discrimination task that allowed us to test subjects near psychophysical limits and to quantify the precise timing of their behavior. We found that respiration frequencies varied widely from 2 to 12 Hz, but odor discrimination was dependent on 6- to 9-Hz sniffing: rats almost always entered and maintained this frequency band during odor sampling and their accuracy on difficult discrimination dropped when they did not. Moreover, the switch from baseline respiration to sniffing occurred not in response to odor delivery but in anticipation of odor sampling and was executed rapidly, almost always within a single cycle. Interestingly, rats also switched from respiration to rapid sniffing in anticipation of reward delivery, but in a distinct frequency band, 9-12 Hz. These results demonstrate the speed and precision of control over respiration and its significance for olfactory behavioral performance.