Although there is much behavioral evidence for complex brain functions in insects, it is not known whether insects have selective attention. In humans, selective attention is a dynamic process restricting perception to a succession of salient stimuli, while less relevant competing stimuli are suppressed. Local field potential recordings in the brains of flies responding to visual novelty revealed attention-like processes with stereotypical temporal properties. These processes were modulated by genes involved in short-term memory formation, namely dunce and rutabaga. Attention defects in these mutants were associated with distinct optomotor effects in behavioral assays.