In Streptococcus thermophilus, gene transfer events and loss of ancestral traits over the years contribute to its high level of adaptation to milk environments. Biofilm formation capacity, a phenotype that is lost in the majority of strains, plays a role in persistence in dairy environments, such as milk pasteurization and cheese manufacturing plants. To investigate this property, we have studied S. thermophilus UC8547, a fast-acidifying dairy starter culture selected for its high capacity to form biofilm on stainless steel under environmental conditions resembling the dairy environment. Using a dynamic flow cell apparatus, it was shown that S. thermophilus UC8547 biofilm formation on stainless steel depends on the presence of milk proteins. From this strain, which harbors the prtS gene for the cell wall protease and shows an aggregative phenotype, spontaneous mutants with impaired biofilm capacity can be isolated at high frequency. These mutants lack the PrtS expendable island, as confirmed by comparison of the genome sequence of UC8547Δ3 with that of the parent strain. The prtS island excision occurs between two 26-bp direct repeats located in the two copies of the ISSth1 flanking this genomic island. The central role of PrtS was confirmed by analyzing the derivative strain UC8547Δ16, whose prtS gene was interrupted by an insertional mutation, thereby making it incapable of biofilm formation. PrtS, acting as a binding substance between the milk proteins adhered to stainless steel and S. thermophilus cell envelopes, mediates biofilm formation in dairy environments. This feature provides S. thermophilus with an ecological benefit for its survival and persistence in this environment.IMPORTANCE The increased persistence of S. thermophilus biofilm has consequences in the dairy environment: if, on the one hand, the release of this microorganism from biofilm can promote the fermentation of artisanal cheeses, under industrial conditions it may lead to undesirable contamination of dairy products. The study of the molecular mechanism driving S. thermophilus biofilm formation provides increased knowledge on how an ancestral trait affects relevant phenotypes, such as persistence in the environment and efficiency of growth in milk. This study provides insight into the genetic factors affecting biofilm formation at dairy plants.