The physiological role of fungal galectins has remained elusive. Here, we show that feeding of a mushroom galectin, Coprinopsis cinerea CGL2, to Caenorhabditis elegans inhibited development and reproduction and ultimately resulted in killing of this nematode. The lack of toxicity of a carbohydrate-binding defective CGL2 variant and the resistance of a C. elegans mutant defective in GDP-fucose biosynthesis suggested that CGL2-mediated nematotoxicity depends on the interaction between the galectin and a fucose-containing glycoconjugate. A screen for CGL2-resistant worm mutants identified this glycoconjugate as a Galbeta1,4Fucalpha1,6 modification of C. elegans N-glycan cores. Analysis of N-glycan structures in wild type and CGL2-resistant nematodes confirmed this finding and allowed the identification of a novel putative glycosyltransferase required for the biosynthesis of this glycoepitope. The X-ray crystal structure of a complex between CGL2 and the Galbeta1,4Fucalpha1,6GlcNAc trisaccharide at 1.5 A resolution revealed the biophysical basis for this interaction. Our results suggest that fungal galectins play a role in the defense of fungi against predators by binding to specific glycoconjugates of these organisms.