Recurrent urinary tract infections (RUTIs) pose a major problem but little is known about characteristics of Escherichia coli associated with RUTI. This study includes E. coli from 155 women with community-acquired lower urinary tract infections (UTIs) randomized to one of three dosing regiments of pivmecillinam and aimed to identify associations between the presence of 29 virulence factor genes (VFGs), phylogenetic groups and biofilm formation and the course of infection during follow-up visits at 8-10 and 35-49 days post-inclusion, respectively. E. coli causing persistence or relapse were more often of phylogenetic group B2 and had a significantly higher aggregate VFG score than E. coli that were not detectable at follow-up. Specifically, these E. coli causing persistence or relapse were characterized by a higher prevalence of hemolysis and 12 VFGs (sfa/focDE, papAH, agn43, chuA, fyuA, iroN, kpsM II, kpsM II K2, cnf1, hlyD, malX and usp). KpsM II K2 and agn43a(CFT073) were independently associated with persistence or relapse. No specific combination of presence/absence of VFGs could serve as a marker to predict RUTI. Stratifying for VFGs, seven days of pivmecillinam treatment reduced the prevalence of persistence or relapse of UTI compared with three days. In vitro biofilm formation was not higher among E. coli causing persistence or relapse. The presence of agn43a(CFT073) or agn43b(CFT073) was associated with biofilm forming capacity. In conclusion, our results show potential targets for prevention and treatment of persistence/relapse of UTI and potential markers for selecting treatment lengths and warrant studies of these and new VFGs.