We studied the effect of early pathogenic Escherichia coli infection on newborn calves’ intestinal barrier and immune function. A total of 64 newborn Holstein male calves (40–43 kg) were divided into two groups: normal (NG) and test (TG), each with 32 heads. At the beginning of the experiment, the TG calves were orally administered pathogenic E. coli O1 (2.5 × 1011 CFU/mL, 100 mL) to establish a calf diarrhea model. In contrast, the NG calves were given the same amount of normal saline. During the 30 d trial period, the feeding and management of the two groups remained constant. Enzyme-linked immunosorbent assay, quantification PCR, and high-throughput 16S rRNA sequencing technology were used to detect indicators related to the intestinal barrier and immune function in the calf serum and tissues. Pathogenic E. coli O1 had a significant effect on calf diarrhea in the TG; it increased the bovine diamine oxidase (P < 0.05) and endotoxin levels in the serum and decreased (P < 0.05) the intestinal trefoil factor (P < 0.05), Occludin, Claudin-1, and Zonula Occludens 1 (ZO-1) levels in the colon tissue, as well as downregulated the mRNA expression of Occludin, Claudin-1,and ZO-1 in the colon mucosa, leading to increased intestinal permeability and impaired intestinal barrier function. Additionally, pathogenic E. coli had a significant impact on the diversity of colonic microbial flora, increasing the relative abundance of Proteobacteria at the phylum level and decreasing the levels of Firmicutes and Bacteroides. At the genus level, the relative abundance of Escherichia and Shigella in the TG increased significantly (P < 0.05), whereas that of Bacteroides, Butyricicoccus, Rikenellaceae_RC9_gut_group, Blautia, and Lactobacillus was significantly decreased (P < 0.05). In addition, the level of IL-6 in the serum of the TG calves was significantly increased (P < 0.05), whereas the IL-4 and IL-10 levels were significantly decreased (P < 0.05), compared to those in the NG calves. Thus, pathogenic E. coli induced diarrhea early in life disrupts intestinal barrier and impairs immune function in calves.