Attention operates at an early stage in some experimental paradigms and at a late stage in others, which suggests that the locus of selection is flexible. The present study was designed to determine whether the locus of selection can vary flexibly within a single experimental paradigm as a function of relatively modest variations in stimulus and task parameters. In the first experiment, a new method for assessing the locus of selection was developed. Specifically, attention can influence perceptual encoding only if it is directed to the target before a perceptual representation of the target has been formed, whereas attention can influence postperceptual processes even if attention is cued after perception is complete. Event-related potentials were used to confirm the validity of this method. The subsequent experiments used cueing tasks in which subjects were required to perceive and remember a set of objects, and the difficulty of the perception and memory components of the task were varied. When the task overloaded perception but not working memory, attention influenced the formation of perceptual representations but not the storage of these representations in memory; when the task overloaded working memory but not perception, attention influenced the transfer of perceptual representations into memory but not the formation of the perceptual representations. Thus, attention operates to select relevant information at whatever stage or stages of processing are overloaded by a particular stimulus-task combination.