Attention influences what is later remembered, but little is known about how this occurs in the brain. We hypothesized that behavioral goals modulate the attentional state of the hippocampus to prioritize goal-relevant aspects of experience for encoding. Participants viewed rooms with paintings, attending to room layouts or painting styles on different trials during high-resolution functional MRI. We identified template activity patterns in each hippocampal subfield that corresponded to the attentional state induced by each task. Participants then incidentally encoded new rooms with art while attending to the layout or painting style, and memory was subsequently tested. We found that when task-relevant information was better remembered, the hippocampus was more likely to have been in the correct attentional state during encoding. This effect was specific to the hippocampus, and not found in medial temporal lobe cortex, category-selective areas of the visual system, or elsewhere in the brain. These findings provide mechanistic insight into how attention transforms percepts into memories.long-term memory | selective attention | hippocampal subfields | medial temporal lobe | representational stability W hy do we remember some things and not others? Consider a recent experience, such as the last movie complex you visited, flight you took, or restaurant at which you ate. More information was available to your senses than was stored in memory, such as the theater number of the movie, the faces of other passengers, and the color of the napkins. The selective nature of memory is adaptive, because encoding carries a cost: newly stored memories can interfere with existing ones and with our ability to learn new information in the future. What is the mechanism by which information gets selected for encoding?Attention offers a means of prioritizing information in the environment that is most relevant to behavioral goals. Attended information, in turn, has stronger control over behavior and is represented more robustly in the brain (1, 2). If attention gates which information we perceive and act upon, then it may also determine what information we remember. Indeed, attention during encoding affects both subsequent behavioral expressions of memory (3) and the extent to which activity levels in the brain predict memory formation (4-7). Although these findings suggest that attention modulates processes related to memory, how it does so is unclear.According to biased competition and other theories of attention (1, 8), task-relevant stimuli are more robustly represented in sensory systems, and thus fare better in competition with taskirrelevant stimuli for downstream processing. Indeed, there is extensive evidence that attention enhances overall activity in visual areas that represent attended vs. unattended features and locations (2, 9). Moreover, attention modulates cortical areas of the medial temporal lobe that provide input to the hippocampus (10-12).Attention can also modulate the hippocampus itself. Specifically, there is g...