Cariogenic Streptococcus mutans is known as a predominant etiological agent of dental caries due to its exceptional capacity in forming biofilms. From strains of S. mutans isolated from dental plaque, we here discover a polyketide/non-ribosomal peptide biosynthetic gene cluster, muf, which directly correlates with a strong biofilm-forming capability. We then identify the muf-associated bioactive product, mutanofactin-697 that contains a novel molecular scaffold, along with its biosynthetic logic. Further mode-of-action studies reveal mutanofactin-697 binds to S. mutans cells nonspecifically, increases bacterial hydrophobicity, and promotes bacterial adhesion and subsequent biofilm formation. Our findings provide the first example of a microbial secondary metabolite promoting biofilm formation via a physicochemical approach, highlighting the significance of secondary metabolism in mediating critical processes related to the development of dental caries.