The response properties of cells in the primary visual cortex (V1) were measured while the animals directed their attention either to the position of the neuron's receptive field (RF), to a position away from the RF (focal attention), or to four locations in the visual field (distributed attention). Over the population, varying attentional state had no significant effect on the response to an isolated stimulus within the RF but had a large influence on the facilitatory effects of contextual lines. We propose that the attentional modulation of contextual effects represents a gating of long range horizontal connections within area V1 by feedback connections to V1 and that this gating provides a mechanism for shaping responses under attention to stimulus configuration.