Empirical studies on the group-size effect (a reduction in time allocated to vigilance with an increase in group size that releases more time for foraging) have generally assumed that the influence of companions is the same irrespective of nearest-neighbour distance. However, social information transmission has been found to be affected by neighbour distance. Our goal was to assess the role of both group size and neighbour distance in explaining foraging and scanning behaviour in flocks of brown-headed cowbirds, Molothrus ater. We conducted a seminatural experiment in which we simultaneously manipulated group size (3, 5, 7 individuals) and minimum neighbour distance (0, 2.5, 5 m) of birds in visual but not physical contact. Foraging and vigilance were affected by both flock size and neighbour distance in different ways. Flock size generally influenced foraging and scanning behaviour, with an initial increase/decrease and then a levelling off at higher flock sizes. Neighbour distance also affected individual behaviour in a nonlinear fashion, but we also found patterns for pecking rate and proportion of time scanning that suggest linear changes. We found that the strength of the group-size effect varied with neighbour distance and was weakest when the birds were furthest away from each other. Future studies should consider as members of a group only those individuals within a radius that allows detection and dilution effects to operate.