In this research, the one-pot multi-component reaction of β-ketoesters with aryl aldehydes and urea/thiourea has been performed using a dual-functional ionic liquid-catalyst namely N1,N1,N2,N2-tetramethylethylenediaminium-N1,N2-disulfonic acid trifluoroacetate ([TMEDSA][TFA]2) in solvent-free conditions. By reason of dual-functionality of the catalyst (possessing acidic and basic sites), and also having two numbers of each site, it was highly effectual and general catalyst, and afforded the products {3,4-dihydropyrimidin-2-(1H)-ones and 3,4-dihydropyrimidin-2-(1H)-thiones} in short times with excellent yields. Moreover, a plausible mechanism based on dual-functionality of the catalyst has been proposed.