Extraintestinal pathogenic Escherichia coli (ExPEC) is an important pathogen that can cause systemic infections in a broad spectrum of mammals and birds. To date, commercial vaccines against ExPEC infections in pigs are rare and antibiotic resistance has become a serious clinical problem. Identification of protective antigens is helpful for developing potentially effective vaccines. In this study, two outer membrane porins, OmpC and OmpF, of porcine ExPEC were cloned and expressed to investigate their immunogenicity. Intraperitoneal immunization of mice with the purified recombinant proteins OmpC and OmpF stimulated strong immunoglobulin G (IgG) antibody responses. Both IgG1 and IgG2a subclasses were induced, with a predominance of IgG1 production. After challenge with 2.5 × 107 CFU (5 × LD50) of the highly virulent ExPEC strain PCN033, 62.5% and 87.5% protection was observed in mice immunized with OmpC and OmpF, respectively. In addition, both anti-OmpC and anti-OmpF sera can mediate complement-dependent opsonophagocytosis. Phylogenetic analysis showed that the ompC gene was ubiquitously present in all E. coli strains, whereas the ompF gene was mutated in certain strains. Furthermore, the selection analysis indicated that gene ompC may be subject to strong immune pressure. Our results demonstrated that OmpC is a promising vaccine target against ExPEC infections in swine.