Abstract The high prevalence of anthelmintic resistance observed in recent years necessitates a reduced reliance on chemotherapy against endoparasites in small ruminants and increased reliance on other agents. Tannin-rich legume forages may assist with this need as they negatively impact endoparasites. The efficiency in the use of tannin-containing legumes in grazing systems may be improved if parasitized animals are allowed to self-select plants in pastures that offer multiple forages. The objectives of this study were to 1) evaluate the effects of the tanniferous legume Onobrychis viciifolia (sainfoin) on Haemonchus contortus infection in sheep, and 2) determine if parasitized sheep (group SAN) increased preferences for this legume after they experienced the antiparasitic effects of tannins. We compared their response with parasitized animals (group CIC) that grazed the non-tanniferous legume Astragalus cicer (cicer milkvetch). Two groups of lambs (6 pairs/group) were familiarized with the legumes, and then pairs of lambs were offered choices between sainfoin and cicer milkvetch pastures (Baseline 1). The foraging behavior of each pair of lambs was recorded at 1-min intervals for 30min using scan sampling. Subsequently, all lambs were dosed with 10,000 L3 stage H. contortus larvae. Twenty-two days later, animals in the group SAN grazed sainfoin while animals in the group CIC grazed cicer milkvetch for 23 days. After this exposure, lambs were offered choices as described above (Preference Tests 1 and 2). Finally, parasitic infections were terminated by chemotherapy, and all lambs were again given choices between the two legumes (Baseline 2). Lambs in the group SAN showed a greater proportion of scans on sainfoin (82 vs. 60% of scans) and a lower proportion of scans on cicer milkvetch (18 vs. 40% of scans) than lambs in the group CIC (P<0.001). The proportion of scans observed on sainfoin or cicer milkvetch did not change for lambs in group SAN from one testing period to the next (P>0.10). In contrast, the proportion of scans observed for lambs in group CIC on sainfoin increased from Baseline 1 to Preference Test 1 (from 39 to 67% of the scans; P=0.004) and from Preference Test 2 to Baseline 2 (from 54 to 79% of the scans; P=0.008). The proportion of scans observed for lambs in CIC on cicer milkvetch decreased from Baseline 1 to Preference Test 1 (from 61 to 33% of the scans; P=0.004), and from Preference Test 2 to Baseline 2 (from 46 to 21% of the scans; P=0.008). After exposure to the experimental pastures, lambs in the group SAN displayed lower fecal egg counts than lambs in the group CIC (before Test 2; 5701 vs. 6979 eggs/g of feces; P=0.07). The number of white (17.0 vs. 36.3K/μl) and red blood cells (4.65 vs. 6.02M/μl) and haematocrit (22.6 vs. 28.6%) were lower for animals in CIC than for animals in SAN (P≤0.1), suggesting a lower incidence of anemia in the group SAN. These results suggest exposure to sainfoin attenuated parasitic burdens in sheep. The uniform use of sainfoin by parasitized lambs also suggests preferences for the legume would remain high even when grazed for several days and despite the availability of alternative legumes like cicer milkvetch. Exposure to sainfoin or cicer milkvetch by parasitized lambs affected subsequent preference for the two legumes in choice tests likely due to positive postingestive effects induced by tannins in nutrition and health.