The effect of attention on the detection and identification of vertically and horizontally oriented Gabor patterns in the condition of simultaneous masking with obliquely oriented Gabors was studied. Attention was manipulated by varying the set size in a visual-search experiment. In the first experiment, small target Gabors were presented on the background of larger masking Gabors. In the detection task, the effect of set size was as predicted by unlimited-capacity signal detection theory. In the orientation identification task, increasing the set size from 1 to 8 resulted in a much larger decline in performance. The results of the additional experiments suggest that attention can reduce the crowding effect of maskers.