Vaginal Escherichia coli colonization is related to obstetric infections and the consequent development of infections in newborns. Ampicillin resistance among E. coli strains is increasing, which is the main choice for treating empirically many obstetric and neonatal infections. Vaginal E. coli strains are very similar to extraintestinal pathogenic E. coli with regards to the virulence factors and the belonging to phylogroup B2. We studied the antimicrobial resistance and the genetic virulence profile of 82 E. coli isolates from 638 vaginal samples and 63 isolated from endometrial aspirate, placental and amniotic fluid samples from pregnant women with obstetric infections. The prevalence of E. coli in the vaginal samples was 13%, which was significant among women with associated risk factors during pregnancy, especially premature preterm rupture of membranes (p<0.0001). Sixty-five percent of the strains were ampicillin-resistant. The E. coli isolates causing obstetric infections showed higher resistance levels than vaginal isolates, particularly for gentamicin (p = 0.001). The most prevalent virulence factor genes were those related to the iron uptake systems revealing clear targets for interventions. More than 50% of the isolates belonged to the virulent B2 group possessing the highest number of virulence factor genes. The ampicillin-resistant isolates had high number of virulence factors primarily related to pathogenicity islands, and the remarkable gentamicin resistance in E. coli isolates from women presenting obstetric infections, the choice of the most appropriate empiric treatment and clinical management of pregnant women and neonates should be carefully made. Taking into account host-susceptibility, the heterogeneity of E. coli due to evolution over time and the geographical area, characterization of E. coli isolates colonizing the vagina and causing obstetric infections in different regions may help to develop interventions and avoid the aetiological link between maternal carriage and obstetric and subsequent puerperal infections.