Trichloroacetic acid was found to be a convenient catalyst for the synthesis of 3,4-dihydropyrimidin-2-(1H)-ones and their corresponding 2(1H)-thiones through a one-pot three-component reaction of aldehydes, alkyl acetoacetate, and urea or thiourea at 70°C under solvent-free conditions.