As a measure of parasitoid resistance, hemocyte load and encapsulation ability were measured in lines collected from natural populations of Drosophila melanogaster in Europe. Results show large geographic variation in resistance against the parasitoid wasp Asobara tabida among the field lines, but there was no clear correlation between resistance and total hemocyte load, neither before nor after parasitization. This was in contrast to the patterns that had been found in a comparison among species of Drosophila, where total hemocyte counts were positively correlated to encapsulation rates. This suggests that the mechanisms underlying between-species variation in parasitoid resistance do not extend to the natural variation that exists within a species. Although hemocyte counts did not correspond to encapsulation ability within D. melanogaster, the ratios of lamellocytes and crystal cells were very similar in lines with successful encapsulation responses. Apart from variation in the hemocytic response of the different hemocyte types, within-species variation was also observed for accurate targeting of the foreign body by the hemocytes. These results are discussed in the context of possible causes of variation in immune functions among natural populations. (C) 2012 Elsevier Ltd. All rights reserved.