Local field potential (LFP) power in the gamma frequency is modulated by cognitive variables during task execution. We sought to examine whether such modulations only emerge when task rules are established. We therefore analyzed neuronal firing and LFPs in different prefrontal subdivisions before and after the same monkeys were trained to perform cognitive tasks. Prior to task rule learning, sites containing neurons selective for stimuli already exhibited increased gamma power during and after the passive viewing of stimuli compared to the baseline period. Unexpectedly, when the same monkeys learned to maintain these stimuli in working memory, the elevation of gamma power above the baseline was diminished, despite an overall increase in firing rate. Learning and executing the task further decoupled LFP power from single neuron firing. Gamma power decreased at the time when subjects needed to make a judgment about whether two stimuli were the same or not, and differential gamma power was observed for matching and nonmatching stimuli. Our results indicate that prefrontal gamma power emerges spontaneously, not necessarily tied to a cognitive task being executed.