Selective attention and memory play powerful roles in the processing of visual information by cortical neurons. Unwanted information is filtered from the receptive fields of extrastriate neurons, explaining why we have little awareness of ignored stimuli. Attention thus gates access to memory. Conversely, memory also plays an important role in determining the stimuli to which we attend. New or not-recently-seen stimuli cause the greatest activation of adaptive mnemonic cells in the visual cortex, biasing attention towards new items in a bottom-up manner. Many times, though, we need to search for a particular object in a scene and ignore irrelevant ones, irrespective of their novelty or recency. In this case, top-down mechanisms activate a separate population of visual neurons in expectation of the relevant item and may cause a potentiated response when the item appears. The interplay of these different cortical memory mechanisms may determine the stimuli that are attended and acted upon by motor systems.