Compositions comprising a milk-derived oligosaccharide such as trifucosyl(1,2-1,2-1,3)-lacto-N-octoase (TFiLNO) and uses thereof for inhibiting invasion of gastrointestinal pathogen into intestinal epithelial cells or for treating an infectious disease (e.g., a disease caused by a gastrointestinal pathogen such as an ETEC) or an inflammatory diseases such as inflammatory bowel disease.