A mutant of Erythrina corallodendron lectin was generated with the aim of enhancing its affinity for N-acetylgalactosamine. A tyrosine residue close to the binding site of the lectin was mutated to a glycine in order to facilitate stronger interactions between the acetamido group of the sugar and the lectin which were prevented by the side chain of the tyrosine in the wild-type lectin. The crystal structures of this Y106G mutant lectin in complex with galactose and N-acetylgalactosamine have been determined. A structural rationale has been provided for the differences in the relative binding affinities of the wild-type and mutant lectins towards the two sugars based on the structures. A hydrogen bond between the O6 atom of the sugars and the variable loop of the carbohydrate-binding site of the lectin is lost in the mutant complexes owing to a conformational change in the loop. This loss is compensated by an additional hydrogen bond that is formed between the acetamido group of the sugar and the mutant lectin in the complex with N-acetylgalactosamine, resulting in a higher affinity of the mutant lectin for N-acetylgalactosamine compared with that for galactose, in contrast to the almost equal affinity of the wild-type lectin for the two sugars. The structure of a complex of the mutant with a citrate ion bound at the carbohydrate-binding site that was obtained while attempting to crystallize the complexes with sugars is also presented.