A series of ferrocene-containing dihydropyrimidines (DHPs) were prepared by the one-pot Biginelli reaction of formylferrocene, 1,3-dicarbonyl component and urea/thiourea. The reaction was catalyzed by a commercial Keggin heteropolyacid (H₄SiMo₁₂O₄₀) as a safe, clean and recyclable catalyst. Three different synthetic protocols were examined in order to improve the yields of the reaction and to elucidate its mechanism. Intermediates of the competitive Knoevenagel reaction were also isolated. The methodology is operationally simple and provides access to highly substituted dihydropyrimidines containing ferrocene in very good yields. The catalyst can be used and recycled without appreciable loss of the catalytic activity.