Dental caries, a biofilm-related oral disease, is a result of disruption of the microbial ecological balance in the oral environment. Streptococcus mutans, which is one of the primary cariogenic bacteria, produces glucosyltransferases (Gtfs) that synthesize extracellular polysaccharides (EPSs). The EPSs, especially water-insoluble glucans, contribute to the formation of dental plaque, biofilm stability, and structural integrity, by allowing bacteria to adhere to tooth surfaces and supplying the bacteria with protection against noxious stimuli and other environmental attacks. The identification of novel alternatives that selectively inhibit cariogenic organisms without suppressing oral microbial residents is required. The goal of the current study is to investigate the influence of an oxazole derivative on S. mutans biofilm formation and the development of dental caries in rats, given that oxazole and its derivatives often exhibit extensive and pharmacologically important biological activities. Our data shows that one particular oxazole derivative, named 5H6, inhibited the formation of S. mutans biofilms and prevented synthesis of extracellular polysaccharides by antagonizing Gtfs in vitro, without affecting the growth of the bacteria. In addition, topical applications with the inhibitor resulted in diminished incidence and severity of both smooth and sulcal surface caries in vivo with a lower percentage of S. mutans in the animals' dental plaque compared to the control group (P<0.05). Our results showed that this oxazole derivative has the capacity to inhibit biofilm formation and cariogenicity of S. mutans.