Dihydrothiazolo ring-fused 2-pyridones have previously been shown to inhibit pilus assembly in uropathogenic Escherichia coli. Methods have now been developed to synthesize both dihydroimidazolo and dihydrooxazolo ring-fused 2-pyridones. To obtain the nitrogen analogs, Cbz-protected imidazolines were reacted with an acyl-Meldrum's acid derivative under acidic conditions. To prepare the oxygen analogs, a one-pot procedure was developed that allowed synthesis of dihydrooxazolo ring-fused 2-pyridones starting from acylated serine derivatives. After hydrolysis to their corresponding carboxylic acids and lithium carboxylates, biological evaluation revealed that the sulfur could be replaced by an oxygen atom and still maintains the ability to inhibit pilus assembly in uropathogenic E. coli. However, introducing a secondary amine instead of oxygen resulted in a substantial decrease in biological activity.